gitlogin

0.0.1 • Public • Published

npm versi mit license build status coverage status deps status

Modern, simplified Github login, CLI and API - generating personal access token. Support promises and node-style callbacks.

Install

npm install gitlogin
npm test
gitlogin --help

Usage

For more use-cases see the tests. You can run node example.js to try it.

var gitlogin = require('gitlogin');
 
var opts = {
  //auth: 'username:password'
  username: 'your github username',
  password: 'your github pass',
  scopes: ['repo', 'gist'],
  note: 'My awesome cli login'
};
 
// callback-style
gitlogin(opts, function cb(err, res) {
  console.log('FROM CB:', err, res);
})
 
// or promise-style
gitlogin(opts)
.then(console.log)
.catch(console.error)
 
// or hybrid
gitlogin(opts, function cb(err, res) {
  console.log('FROM CB:', err, res);
})
.then(console.log)
.catch(console.error)

API

CLI

$ gitlogin --help
 
  Modern, simplified Github login, CLI and API - generating personal access token. Support promises and node-style callbacks.
 
  Options
    --help                   Show this help
    --version                Current version of package
    -u | --username          Your Github username, required
    -p | --password          Your Github password, required
    -s | --scopes            Scopes for github, not required
    -n | --note              Note for the app, not required
    -t | --token-only        If you want to show only token
    -j | --json         Output full JSON.stringified response
 
  Usage
    gitlogin <username> <password> [scopes] [note]
    gitlogin -p <password> -n [note] -u <username> -s [scopes]
 
  Examples
    gitlogin tunnckoCore myPassword 'repo, gist, delete_repo' 'some note for app'
    gitlogin tunnckoCore myPassword repo,gist,delete_repo 'some note for app'
    gitlogin tunnckoCore myPassword '' '' true false
    gitlogin --username tunnckoCore --password myPassword
    gitlogin --scopes repo,gist,delete_repo -u tunnckoCore -n myAwesomeApp -p myPassword
    gitlogin -u tunnckoCore -p myPassword

Author

Charlike Mike Reagent

License MIT license

Copyright (c) 2014 Charlike Mike Reagent, contributors.
Released under the MIT license.


Powered and automated by readdirp + hogan.js, December 24, 2014

Dependents (0)

Package Sidebar

Install

npm i gitlogin

Weekly Downloads

6

Version

0.0.1

License

MIT

Last publish

Collaborators

  • vanchoy
  • tunnckocore