# rollodeqc-gh-utils

> RoLLodeQc GitHub utilities.

Latest version **1.0.0** (published 2019-07-11) · AGPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install rollodeqc-gh-utils
pnpm add rollodeqc-gh-utils
yarn add rollodeqc-gh-utils
bun add rollodeqc-gh-utils
```

Provides the command `rollodeqc-gh-utils`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-07-11 |
| First published | 2016-04-01 |
| Weekly downloads | 0 |
| License | AGPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10.16.0 |
| Dependencies | 6 |
| Unpacked size | 42 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Robin Millette |
| Maintainers | millette |
| Keywords | rollodeqc, github, gh, utils, cli |

## Links

- npm: https://www.npmjs.com/package/rollodeqc-gh-utils
- Repository: https://github.com/millette/rollodeqc-gh-utils
- Homepage: https://github.com/millette/rollodeqc-gh-utils#readme
- Issues: https://github.com/millette/rollodeqc-gh-utils/issues
- npm.io page: https://npm.io/package/rollodeqc-gh-utils

## Dependencies (6)

- [meow](https://npm.io/package/meow.md) ^5.0.0
- [gh-got](https://npm.io/package/gh-got.md) ^8.1.0
- [lodash.flow](https://npm.io/package/lodash.flow.md) ^3.5.0
- [lodash.omitby](https://npm.io/package/lodash.omitby.md) ^4.6.0
- [lodash.pickby](https://npm.io/package/lodash.pickby.md) ^4.6.0
- [lodash.partial](https://npm.io/package/lodash.partial.md) ^4.2.1

## Alternatives

- [@oh-my-pi/pi-natives](https://npm.io/package/@oh-my-pi/pi-natives.md) — 51.8K weekly downloads
- [@capgo/capacitor-light-sensor](https://npm.io/package/@capgo/capacitor-light-sensor.md) — 3.0K weekly downloads
- [@heyhuynhgiabuu/pi-diff](https://npm.io/package/@heyhuynhgiabuu/pi-diff.md) — 492 weekly downloads
- [@lotsa/verdant-lang-asm](https://npm.io/package/@lotsa/verdant-lang-asm.md) — 38 weekly downloads
- [new-era-syntax](https://npm.io/package/new-era-syntax.md) — 20 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-07-11
- 0.4.3 — 2019-07-11
- 0.4.2 — 2019-07-11
- 0.4.1 — 2019-06-28
- 0.4.0 — 2018-08-25
- 0.3.4 — 2016-09-11
- 0.3.3 — 2016-07-23
- 0.3.2 — 2016-06-25
- 0.3.1 — 2016-06-19
- 0.3.0 — 2016-04-09
- 0.2.0 — 2016-04-04
- 0.1.1 — 2016-04-01
- 0.1.0 — 2016-04-01

## README

# rollodeqc-gh-utils
[![Build Status](https://travis-ci.org/millette/rollodeqc-gh-utils.svg?branch=master)](https://travis-ci.org/millette/rollodeqc-gh-utils)
[![Coverage Status](https://coveralls.io/repos/github/millette/rollodeqc-gh-utils/badge.svg?branch=master)](https://coveralls.io/github/millette/rollodeqc-gh-utils?branch=master)
[![Dependency Status](https://gemnasium.com/badges/github.com/millette/rollodeqc-gh-utils.svg)](https://gemnasium.com/github.com/millette/rollodeqc-gh-utils)

> RoLLodeQc GitHub utilities.

## Install
```
$ npm install --save rollodeqc-gh-utils
```

## Usage
```js
const rollodeqcGhUtils = require('rollodeqc-gh-utils')

rollodeqcGhUtils.rateLimit().then((result) => {
  console.log(JSON.stringify(result, null, ' '))
})
//=>
{
 "rate": {
  "limit": 5000,
  "remaining": 5000,
  "reset": 1459470151
 },
 "headers": {
  "server": "GitHub.com",
  "date": "Thu, 31 Mar 2016 23:22:31 GMT",
  "status": "200 OK",
  "x-ratelimit-limit": 5000,
  "x-ratelimit-remaining": 5000,
  "x-ratelimit-reset": 1459470151,
  "timestamp": 1459466551,
  "timestampDiff": 2.87,
  "statusCode": 200
 }
}
```

## API
### rollodeqcGhUtils.got(url[, obj])
Fetch json documents from GitHub.
Like [ghGot](https://github.com/sindresorhus/gh-got)
with a little sugar added. Only some headers are kept and parsed.

Returns a promise.

#### url
Type: `string`

#### obj
Type: `object`<br>
Default: `{}`

See ghGot. Good for token, etc.
Note that the token can be overridden globally with the `GITHUB_TOKEN` environment variable.

### rollodeqcGhUtils.rateLimit()
Fetch current rate limit and return a promise.

### rollodeqcGhUtils.links(result)
Parses result.headers.link and returns an object with next, previous and last links.

#### result
Type: `object`

### rollodeqcGhUtils.wait(result)
Return time to wait (in ms) between calls to got() to respect the rate limit.

#### result
Type: `object`

### rollodeqcGhUtils.chosenHeaders(headers)
Lorem ipsum.

#### headers
Type: `object`

### rollodeqcGhUtils.chosenFields(fields)
Lorem ipsum.

#### fields
Type: `object`

## Dependencies
* gh-got
* lodash.pickby
* lodash.omitby
* lodash.flow
* lodash.partial

## License
AGPL-v3 © [Robin Millette](http://robin.millette.info)

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