gh-patch
v1.0.0
Published
Create a PATCH request to the Github API
Downloads
5
Maintainers
Readme
gh-patch
A Node module to create a PATCH
request to the Github API
const ghPatch = require('gh-patch');
// https://developer.github.com/v3/gists/#edit-a-gist
ghPatch('/gists/2790533', {
headers: {
'user-agent': 'your application name'
},
token: 'your access token',
body: {
description: 'New description'
}
}).then(response => {
response.headers.status; //=> '200 OK'
console.log('Updated the gist description.');
});
Installation
npm install gh-patch
API
const ghPatch = require('gh-patch');
ghPatch(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 'PATCH'
and unchangable.
License
Copyright (c) 2015 Shinnosuke Watanabe
Licensed under the MIT License.