Skip to content

nomcopter/simple-gist-client

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

A simple client for Gist

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%