# nanogist

> Isomorphic gist client

Latest version **1.0.0** (published 2018-02-13) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2018-02-13 |
| First published | 2018-02-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 1 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Tobias Herber |
| Maintainers | tobihrbr |
| Keywords | gist, github, api, client |

## Links

- npm: https://www.npmjs.com/package/nanogist
- Repository: https://github.com/herber/nanogist
- Homepage: https://github.com/herber/nanogist#readme
- Issues: https://github.com/herber/nanogist/issues
- npm.io page: https://npm.io/package/nanogist

## Dependencies (1)

- [isomorphic-fetch](https://npm.io/package/isomorphic-fetch.md) ^2.2.1

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-02-13

## README

# Nanogist

Isomorphic gist client

## Install

```
$ npm install nanogist
```

## Usage

```js
const nanogist = require('nanogist');
const gist = nanogist('token');

gist.get('fa43cd476b09d1f10aebf4cac0351c4e').then((data) => {
  console.log(data);
})
```

## API

## nanogist([token])

#### token

Type: `string`

Your OAuth token for accessing github's api.

If no token is supplied you can only create anonymous gists.

#### .get(id)

Get a gists content by it's id.

##### Example

```js
gist.get('50d1014b0e35be4675b6917719afb2de').then((content) => {
  console.log('Username: ' + content.owner.login);
});
```

#### .create(data)

Create a new gist.

##### Example

```js
gist.create({
  description: 'A new gist.',
  public: false,
  files: {
    'home.txt': {
      content: 'String file contents'
    }
  }
}).then((content) => {
  console.log('ID:', data.id);
});
```

#### .update(id, data)

Update a gist.

##### Example

```js
gist.update('50d1014b0e35be4675b6917719afb2de', {
  files: {
    'home.txt': null,
    'new_file.txt': {
      content: 'a new file'
    },
  }
}).then((data) => {
  console.log('Files:', data.files);
});
```

#### .delete(id)

Delete a gist.

##### Example

```js
gist.delete('50d1014b0e35be4675b6917719afb2de').then((deleted) => {
  console.log(deleted);
})
```

## License

MIT © [Tobias Herber](http://tobihrbr.com)

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