{"name":"ghreleases","version":"1.0.4","description":"Interact with the GitHub releases API","main":"ghreleases.js","scripts":{"test":"node test.js | faucet"},"repository":{"type":"git","url":"git+https://github.com/ralphtheninja/ghreleases.git"},"keywords":["github","api","releases"],"author":{"name":"Magnus Skog","email":"ralphtheninja@riseup.net"},"license":"MIT","dependencies":{"after":"~0.8.1","ghrepos":"~2.0.0","ghutils":"~3.2.0","simple-mime":"~0.1.0","url-template":"~2.0.6","xtend":"~4.0.0"},"devDependencies":{"faucet":"0.0.1","tape":"~4.3.0"},"gitHead":"3b01aefa776784bdb0f130391aff81053770e95f","bugs":{"url":"https://github.com/ralphtheninja/ghreleases/issues"},"homepage":"https://github.com/ralphtheninja/ghreleases#readme","_id":"ghreleases@1.0.4","_shasum":"73f93143d572e397c0c3899be05ad7d08d6ee3dc","_from":".","_npmVersion":"3.5.2","_nodeVersion":"4.2.3","_npmUser":{"name":"ralphtheninja","email":"ralphtheninja@riseup.net"},"maintainers":[{"name":"ralphtheninja","email":"ralphtheninja@riseup.net"},{"name":"rvagg","email":"rod@vagg.org"}],"dist":{"shasum":"73f93143d572e397c0c3899be05ad7d08d6ee3dc","tarball":"http://registry-npm.ywwl.com/ghreleases/download/ghreleases-1.0.4.tgz","integrity":"sha512-D4aphc0jRyaEeGyygFlufJtGgaTfn2xdkg1KtQ6U3/21egaenGBIJfP3QeumxRL6LaBRJ0v58IdexMSN0o6DVw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7JKlOZhILxHVxhlL3itJexYlMpysNmwomJhm/dnjMUwIhAPewnTBK5XihW+xwG2XhRDCU/6RI6/CuDcrdCM05KlOw"}],"size":28265,"noattachment":false,"key":"/ghreleases/-/ghreleases-1.0.4.tgz"},"directories":{},"readme":"# ghreleases\n\n> Interact with the GitHub releases API.\n\n[![npm](https://img.shields.io/npm/v/ghreleases.svg)](https://www.npmjs.com/package/ghreleases)\n![node](https://img.shields.io/node/v/ghreleases.svg)\n[![travis](https://secure.travis-ci.org/ralphtheninja/ghreleases.png)](http://travis-ci.org/ralphtheninja/ghreleases)\n[![david](https://david-dm.org/ralphtheninja/ghreleases.svg)](https://david-dm.org/ralphtheninja/ghreleases)\n[![standard](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)\n[![npm](https://img.shields.io/npm/dm/ghreleases.svg)](https://www.npmjs.com/package/ghreleases)\n\n## API\n\n### `list(auth, org, repo[, options], cb)`\n\nList all releases for a repo. Calls back with an array of releases.\n\n```js\nconst gh = require('ghreleases')\nconst auth = {\n  token: '90230948aef88723eca2309880fea09789234',\n  user: 'ralphtheninja'\n}\ngh.list(auth, 'level', 'leveldown', (err, list) => {\n  console.log(list)\n})\n```\n\nGitHub [docs](https://developer.github.com/v3/repos/releases/#list-releases-for-a-repository).\n\n### `getLatest(auth, org, repo[, options], cb)`\n\nGet latest release.\n\n```js\ngh.getLatest(auth, 'level', 'leveldown', (err, release) => {\n  console.log(release)\n})\n```\n\nGitHub [docs](https://developer.github.com/v3/repos/releases/#get-the-latest-release).\n\n### `getById(auth, org, repo, id[, options], cb)`\n\nGet data for a single release.\n\n```js\ngh.getById(auth, 'level', 'leveldown', '1363866', (err, release) => {\n  console.log(release)\n})\n```\n\nGitHub [docs](https://developer.github.com/v3/repos/releases/#get-a-single-release).\n\n### `getByTag(auth, org, repo, tag[, options], cb)`\n\nGet release by tag.\n\n```js\ngh.getByTag(auth, 'level', 'leveldown', 'v1.2.2', (err, release) => {\n  console.log(release)\n})\n```\n\nGitHub [docs](https://developer.github.com/v3/repos/releases/#get-a-release-by-tag-name).\n\n### `create(auth, org, repo, data[, options], cb)`\n\nCreate a release.\n\n```js\nconst data = {\n  tag_name: '1.2.3-test',\n  name: 'Release name for 1.2.3-test',\n  body: 'Body text of release goes here'\n}\ngh.create(auth, 'level', 'leveldown', data, (err, release) => {\n  console.log(release)\n})\n```\n\nThe release on GitHub would then look as follows:\n\n![1.2.3-test release](images/github-release.png?raw=true \"1.2.3-test release\")\n\nGitHub [docs](https://developer.github.com/v3/repos/releases/#create-a-release)\n\n### `uploadAssets(auth, org, repo, release, files[, options], cb)`\n\nUpload assets to a release. Calls back with an array of results for each upload request.\n\n* The `release` parameter accepts either a release `id`, `'latest'` or a valid ref, e.g. `'tags/v1.0.0'`\n* The `files` parameter is an array of absolute file paths that should be uploaded and associated with this release\n\n```js\nconst ref = 'tags/v1.3.0'\nconst files = [\n  '/path/to/README.md',\n  '/path/to/prebuilt/binary.tar.gz'\n]\ngh.uploadAssets(auth, 'level', 'leveldown', ref, files, (err, res) => {\n  console.log(res)\n})\n```\n\nGitHub [docs](https://developer.github.com/v3/repos/releases/#upload-a-release-asset)\n\n## Also See\n\nFor interacting with other parts of the GitHub API, check out the modules below.\n\n* [`ghissues`](https://github.com/rvagg/ghissues)\n* [`ghusers`](https://github.com/rvagg/ghusers)\n* [`ghteams`](https://github.com/rvagg/ghteams)\n* [`ghrepos`](https://github.com/rvagg/ghrepos)\n* [`ghpulls`](https://github.com/rvagg/ghpulls)\n* [`ghauth`](https://github.com/rvagg/ghauth)\n* [`ghutils`](https://github.com/rvagg/ghutils)\n\n## License\n\nMIT\n","publish_time":1450910475542,"_cnpm_publish_time":1450910475542,"dist-tags":{"latest":"3.0.2"}}