1.0.0 • Published 8 years ago

gh-put v1.0.0

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

gh-put

NPM version Build Status Coverage Status Dependency Status devDependency Status

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

const ghPut = require('gh-put');

ghPut('gists/2790533/star', {
  headers: {
    'user-agent': 'your application name'
  },
  token: 'your access token'
}).then(response => {
  response.headers.status; //=> '204 No Content'
  console.log('Successfully starred https://gist.github.com/domenic/2790533');
});

Installation

Use npm.

npm install gh-put

API

const ghPut = require('gh-put');

ghPut(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 'PUT' and unchangable.

License

Copyright (c) 2015 Shinnosuke Watanabe

Licensed under the MIT License.