1.0.0 • Published 8 years ago

gh-delete v1.0.0

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

gh-delete

NPM version Build Status Coverage Status Dependency Status devDependency Status

A Node module to create a DELETE request to the Github API

const ghDelete = require('gh-delete');

ghDelete('gists/6ba9f11f4e1acf136450', {
  headers: {
    'user-agent': 'your application name'
  },
  token: 'your access token'
}).then(response => {
  response.headers.status; //=> '204 No Content'
  console.log('Successfully deleted https://gist.github.com/shinnn/6ba9f11f4e1acf136450');
});

Installation

Use npm.

npm install gh-delete

API

const ghDelete = require('gh-delete');

ghDelete(url , options)

url: String ("path" part of a Github API URL)
options: Object (gh-get options)
Return: Object (Promise instance)

Almost the same as gh-get, except that the method option defaults to 'DELETE' and unchangable.

License

Copyright (c) 2015 Shinnosuke Watanabe

Licensed under the MIT License.