An open API service indexing awesome lists of open source software.

https://github.com/zxdong262/gist-client-js

Github gist api wrapper
https://github.com/zxdong262/gist-client-js

gist gist-client

Last synced: 8 months ago
JSON representation

Github gist api wrapper

Awesome Lists containing this project

README

          

# Github Gist Client for JavaScript

[![Build Status](https://travis-ci.com/zxdong262/gist-client-js.svg?branch=release)](https://travis-ci.com/zxdong262/gist-client-js)

Github gist API wrapper. [api docs](https://developer.github.com/v3/gists/).

## Installation

### Node.js

```bash
npm i gist-wrapper
```

## Usage

```js
import GistWrapper from 'gist-wrapper'

const gc = new GistWrapper(
GITHUB_TOKEN,
userAgentHeaderString
)
let r = await gc.get('/gists/public').catch(console.log)
expect(r.data.length > 0).toBe(true)

// quick methods
gc.getOne(gistId)
gc.create(gistData)
gc.update(gistId, gistData)
gc.delOne(gistId)
```

## Test

```bash
cp .sample.env .env
# edit .env fill your github token
npm run test
```

## Credits

Based on [Tyler](https://github.com/tylerlong)'s [https://github.com/tylerlong/ringcentral-js-concise](https://github.com/tylerlong/ringcentral-js-concise).

## License

MIT