simple-gist-client
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

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)

Readme

Keywords

none

Package Sidebar

Install

npm i simple-gist-client

Weekly Downloads

1

Version

0.2.0

License

MIT

Last publish

Collaborators

  • bouzuya