1.0.0 • Published 8 years ago

gh-patch v1.0.0

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

gh-patch

NPM version Build Status Coverage Status Dependency Status devDependency Status

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

Use npm.

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.