Socket
Book a DemoInstallSign in
Socket

get-github-token

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-github-token

prompt the user for credentials for a github oauth token

latest
Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

get-github-token

Prompt the user for username/password to get a github token. Works with TFA.

an example

var getToken = require('get-github-token')

getToken(['scopes'], 'note!', 'http://noteurl.com/', function(err, token) {
  // token will be a string.
})

// or pass your own github api instance!
var gh = new Github({version: '3.0.0', protocol: 'https'})

getToken(['scopes'], 'note!', 'http://noteurl.com/', gh, function(err, token) {
  // token will be a string.
})

API

getToken(scopes, note, noteUrl[, github], ready)

// signature
getToken(
    scopes:Array<String>
  , note:String
  , noteUrl:String
 [, github:Github]
  , ready:Function(err:Error, token:String)
)

Prompts the user for username/password in order to attain a Github oauth token. Requires a list of scopes, a note string, a note url, and a callback. The callback will receive err or token, where token represents a string containing the oauth token. If not given, the github parameter will be a node-github instance created as a 3.0.0 API against https protocol.

License

MIT

Keywords

github

FAQs

Package last updated on 20 Mar 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts