0.2.0 • Published 7 years ago

simple-gist-client v0.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

simple-gist-client

A simple client for Gist.

Installation

$ npm install simple-gist-client

Usage

import { SimpleGistClient } from 'simple-gist-client';

const token = 'YOUR GITHUB TOKEN';

const data = 456;
const client = new SimpleGistClient({ token });
client
  .create(data)
  .then(id => {
    console.log(`created : https://gist.github.com/${id}`);
    return client.read(id)
      .then(data => {
        console.log(`read : ${data}`); // read : 456
        return client.update(id, 789);
      })
      .then(() => {
        console.log('updated');
        return client.read(id);
      })
      .then(data => {
        console.log(`read : ${data}`); // read : 789
        return client.delete(id);
      })
      .then(() => {
        console.log('deleted');
      });
  })
  .catch(error => {
    console.error(error);
  });

See: examples/

Badges

Circle CI

License

MIT

Author

bouzuya <m@bouzuya.net> (http://bouzuya.net)

0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

8 years ago