octOAuth
A simple Node.js library for getting an Oauth token for Github with a username and password
Installation
Install with npm
npm install -S octoauth # -S adds octoauth to your package.json for you
Usage
You can instantiate octOAuth and pass a hash in with values you want
var octOAuth = ; var params = username: 'taterbase' password: 'password' scopes: 'gist' ; var oa = params;
Or you can assign them later
var oa = ; oausername = 'taterbase';oapassword = 'password';oascopes = 'gist' 'repo';
You can even mix and match
var params = username: 'taterbase' password: 'password'; var oa = params; oascopes = 'gist' ;
After that just call getToken
oa;
Testing
To run tests this module needs a config folder structured like so:
node-octoauth
|
+--config
|
+--index.js
Inside config/index.js you should expose an object with working username and password like so:
moduleexports = username: 'taterbase' password: '123Fake';
Now you can run mocha
and test away.
MIT license