https://github.com/doowb/ask-for-github-auth
Prompt a user for their github authentication credentials and save the results.
https://github.com/doowb/ask-for-github-auth
Last synced: about 2 months ago
JSON representation
Prompt a user for their github authentication credentials and save the results.
- Host: GitHub
- URL: https://github.com/doowb/ask-for-github-auth
- Owner: doowb
- License: mit
- Created: 2015-08-11T00:47:23.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-16T02:54:29.000Z (over 9 years ago)
- Last Synced: 2025-02-26T05:41:30.590Z (about 2 months ago)
- Language: JavaScript
- Size: 126 KB
- Stars: 8
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ask-for-github-auth [](http://badge.fury.io/js/ask-for-github-auth) [](https://travis-ci.org/doowb/ask-for-github-auth)
> Prompt a user for their github authentication credentials and save the results.
Install with [npm](https://www.npmjs.com/)
```sh
$ npm i ask-for-github-auth --save
```## Usage
```js
var ask = require('ask-for-github-auth');
```## API
### [askForGithubAuth](index.js#L60)
Prompt a user for their github authentication credentials. Save the answer so they're only asked once.
**Params**
* `options` **{Object}**: Options to pass to [ask-once](https://github.com/doowb/ask-once)
* `options.store` **{String}**: a [data-store](https://github.com/jonschlinkert/data-store) instance or name that can be passed to [ask-once](https://github.com/doowb/ask-once)
* `cb` **{Function}**: Callback function returning either an error or authentication credentials**Example**
```js
ask(function (err, creds) {
console.log(creds);
//=> {type: 'oauth', token: '123456'}
//=> or {type: 'basic', username: 'doowb', password: 'password'}
});
```## Related projects
* [ask-once](https://github.com/doowb/ask-once): Only ask a question one time and store the answer.
* [data-store](https://github.com/jonschlinkert/data-store): Easily get, set and persist config data.
* [inquirer](https://github.com/sboudrias/Inquirer.js#readme): A collection of common interactive command line user interfaces.
* [question-cache](https://github.com/jonschlinkert/question-cache): A wrapper around inquirer that makes it easy to create and selectively reuse questions.## Running tests
Install dev dependencies:
```sh
$ npm i -d && npm test
```## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/doowb/ask-for-github-auth/issues/new)
## Author
**Brian Woodward**
+ [github/doowb](https://github.com/doowb)
+ [twitter/doowb](http://twitter.com/doowb)## License
Copyright © 2015 Brian Woodward
Released under the MIT license.***
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 20, 2015._