Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/gh-put
Create a PUT request to the Github API
https://github.com/shinnn/gh-put
Last synced: 27 days ago
JSON representation
Create a PUT request to the Github API
- Host: GitHub
- URL: https://github.com/shinnn/gh-put
- Owner: shinnn
- License: mit
- Created: 2015-12-29T07:36:12.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-21T10:45:12.000Z (over 8 years ago)
- Last Synced: 2024-09-17T12:22:10.716Z (about 2 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gh-put
[![NPM version](https://img.shields.io/npm/v/gh-put.svg)](https://www.npmjs.com/package/gh-put)
[![Build Status](https://travis-ci.org/shinnn/gh-put.svg?branch=master)](https://travis-ci.org/shinnn/gh-put)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/gh-put.svg)](https://coveralls.io/github/shinnn/gh-put?branch=master)
[![Dependency Status](https://david-dm.org/shinnn/gh-put.svg)](https://david-dm.org/shinnn/gh-put)
[![devDependency Status](https://david-dm.org/shinnn/gh-put/dev-status.svg)](https://david-dm.org/shinnn/gh-put#info=devDependencies)A [Node](https://nodejs.org/) module to create a [`PUT`](https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6) request to the [Github API](https://developer.github.com/v3/)
```javascript
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.](https://docs.npmjs.com/cli/install)
```
npm install gh-put
```## API
```javascript
const ghPut = require('gh-put');
```### ghPut(*url* [, *options*])
*url*: `String` ("path" part of a Github API URL)
*options*: `Object` ([`gh-get` options](https://github.com/shinnn/gh-get#options))
Return: `Object` ([`Promise`](https://promisesaplus.com/) instance)Almost the same as [gh-get](https://github.com/shinnn/gh-get), except that the `method` option defaults to `'PUT'` and unchangable.
## License
Copyright (c) 2015 - 2016 [Shinnosuke Watanabe](https://github.com/shinnn)
Licensed under [the MIT License](./LICENSE).