0.2.0 • Published 7 years ago
simple-gist-client v0.2.0
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/