updates README with example & changes package name to npr-api
This commit is contained in:
parent
00b78de714
commit
4db26d4f82
2 changed files with 31 additions and 6 deletions
29
README.md
29
README.md
|
|
@ -1,9 +1,34 @@
|
|||
# Node.js NPR API [](https://travis-ci.org/adafruit/npr)
|
||||
# Node.js NPR API [](https://travis-ci.org/adafruit/node_npr)
|
||||
|
||||
A Node.js wrapper for NPR APIs.
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
npm install npr
|
||||
$ mkdir npr_test && cd npr_test
|
||||
$ npm install npr-api
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
As of right now, the full NPR One API is available in this package. There
|
||||
are more examples in the `test` directory.
|
||||
|
||||
**Example:** getting recommendations for your user
|
||||
```
|
||||
var NPR = require('npr-api');
|
||||
|
||||
var npr = NPR({
|
||||
client_id: 'your_client_id',
|
||||
client_secret: 'your_client_secret',
|
||||
username: 'your_username',
|
||||
password: 'your_password'
|
||||
});
|
||||
|
||||
npr.one.init()
|
||||
.then(npr.one.listening.getRecommendations({ channel: 'npr' }))
|
||||
.then(function(recommendations) {
|
||||
console.log(recommendations);
|
||||
}).catch(console.err);
|
||||
|
||||
```
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "npr",
|
||||
"name": "npr-api",
|
||||
"version": "0.1.0",
|
||||
"description": "Node.js NPR API client",
|
||||
"main": "index.js",
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/adafruit/npr.git"
|
||||
"url": "git+https://github.com/adafruit/node_npr.git"
|
||||
},
|
||||
"keywords": [
|
||||
"npr",
|
||||
|
|
@ -20,9 +20,9 @@
|
|||
"author": "Todd Treece <todd@uniontownlabs.org>",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/adafruit/npr/issues"
|
||||
"url": "https://github.com/adafruit/node_npr/issues"
|
||||
},
|
||||
"homepage": "https://github.com/adafruit/npr#readme",
|
||||
"homepage": "https://github.com/adafruit/node_npr#readme",
|
||||
"devDependencies": {
|
||||
"gulp": "^3.9.0",
|
||||
"gulp-jshint": "^1.11.2",
|
||||
|
|
|
|||
Loading…
Reference in a new issue