# octoauth

> Simple OAuth token library for Github

Latest version **0.0.2-1** (published 2012-08-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install octoauth
pnpm add octoauth
yarn add octoauth
bun add octoauth
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2-1 |
| Published | 2012-08-27 |
| First published | 2012-08-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | taterbase |
| Maintainers | taterbase |
| Keywords | github, oauth |

## Links

- npm: https://www.npmjs.com/package/octoauth
- Repository: https://github.com/taterbase/node-octoauth
- npm.io page: https://npm.io/package/octoauth

## Dependencies (2)

- [mocha](https://npm.io/package/mocha.md) ~1.4.0
- [should](https://npm.io/package/should.md) ~1.1.0

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@oxyhq/services](https://npm.io/package/@oxyhq/services.md) — 2.3K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads

## Recent versions

- 0.0.2-1 (latest) — 2012-08-27
- 0.0.2 — 2012-08-25
- 0.0.1-readme — 2012-08-25
- 0.0.1 — 2012-08-25

## README

#octOAuth

A simple Node.js library for getting an Oauth token for Github with a username and password

##Installation

Install with npm

```bash
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

```javascript
var octOAuth = require('octoauth');

var params = {
  username: 'taterbase',
  password: 'password',
  scopes: [ 'gist' ]
};

var oa = new octOAuth(params);
```

Or you can assign them later

```javascript
var oa = new octOAuth();

oa.username = 'taterbase';
oa.password = 'password';
oa.scopes = ['gist', 'repo'];
```

You can even mix and match

```javascript
var params = {
  username: 'taterbase',
  password: 'password'
};

var oa = new octOAuth(params);

oa.scopes = [ 'gist' ];
```

After that just call <code>getToken</code>

```javascript
oa.getToken(function(err, token){
  //Use that token!
});
```

##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:

```javascript
module.exports = {
  username: 'taterbase',
  password: '123Fake'
};
```

Now you can run <code>mocha</code> and test away.

---
MIT license

---
_Source: https://npm.io/package/octoauth · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
