{"name":"ghrepos","version":"2.0.0","description":"Interact with the GitHub repos API","main":"ghrepos.js","scripts":{"test":"node test.js | faucet"},"repository":{"type":"git","url":"git+https://github.com/rvagg/ghrepos.git"},"keywords":["github","repos","repositories","repository"],"author":{"name":"Rod Vagg","email":"r@va.gg"},"license":"MIT","dependencies":{"ghutils":"~3.2.0"},"devDependencies":{"faucet":"0.0.1","tape":"~4.2.2","xtend":"~4.0.0"},"gitHead":"ee0749f6e72a38a0b8edbdfe2321e83199c94687","bugs":{"url":"https://github.com/rvagg/ghrepos/issues"},"homepage":"https://github.com/rvagg/ghrepos#readme","_id":"ghrepos@2.0.0","_shasum":"d66eae9d98a3b5398e460d6db7e10a742692e81b","_from":".","_npmVersion":"3.5.2","_nodeVersion":"4.2.3","_npmUser":{"name":"ralphtheninja","email":"ralphtheninja@riseup.net"},"maintainers":[{"name":"rvagg","email":"rod@vagg.org"},{"name":"ralphtheninja","email":"ralphtheninja@riseup.net"}],"dist":{"shasum":"d66eae9d98a3b5398e460d6db7e10a742692e81b","tarball":"http://registry-npm.ywwl.com/ghrepos/download/ghrepos-2.0.0.tgz","integrity":"sha512-WKekkei1vtl4rvciCSVBIz+l9rNmlAFto2ryk61emqiLUFXpVuWvdPUmP0NVgLv05uxsXGqvs8T+6xKfon49pg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE2vmmozBW3ru2Jfw0aUTfGRyCGv9GrC+NyqG3Kl+lK8AiB5kpVyrhtLuqhEz9fcNoOLbGy6Pu73j3Ak06zaYlYp0A=="}],"size":4275,"noattachment":false,"key":"/ghrepos/-/ghrepos-2.0.0.tgz"},"directories":{},"readme":"# ghrepos\n\n[![Build Status](https://secure.travis-ci.org/rvagg/ghrepos.png)](http://travis-ci.org/rvagg/ghrepos)\n\n**A node library to interact with the GitHub repos API**\n\n[![NPM](https://nodei.co/npm/ghrepos.png?mini=true)](https://nodei.co/npm/ghrepos/)\n\nSee also:\n\n* https://github.com/rvagg/ghissues\n* https://github.com/rvagg/ghusers\n* https://github.com/rvagg/ghteams\n* https://github.com/rvagg/ghauth\n\n## API\n\n### listUser(auth[, user][, options], callback)\n\nList all repos for a user. If `user` and `options` are omitted the current user is assumed.\n\nList all repos for user `'rvagg'`:\n\n```js\nconst ghrepos     = require('ghrepos')\n    , authOptions = { user: 'rvagg', token: '24d5dee258c64aef38a66c0c5eca459c379901c2' }\n\nghrepos.listUser(authOptions, 'rvagg', function (err, repolist) {\n  console.log(reposlist)\n})\n```\n\n### listOrg(auth, org[, options], callback)\n\nList all repos for a organisation. If `org` and `options` are omitted the current org is assumed.\n\nList all repos for org `'nodejs'`:\n\n```js\nconst ghrepos     = require('ghrepos')\n    , authOptions = { user: 'rvagg', token: '24d5dee258c64aef38a66c0c5eca459c379901c2' }\n\nghrepos.listOrg(authOptions, 'nodejs', function (err, repolist) {\n  console.log(reposlist)\n})\n```\n\n### listRefs(auth, org, repo[, options], callback)\n\nGet git ref data for all refs in a repo.\n\nGet all ref data for `nodejs/node` repo:\n\n```js\nghrepos.listRefs(authOptions, 'nodejs', 'node', function (err, refData) {\n  // data containing ref information including sha and github url\n  console.log(refData)\n})\n```\n\n### listBranches(auth, org, repo[, options], callback)\n\nList git branches for a repo.\n\nGet all branches for `nodejs/node` repo:\n\n```js\nghrepos.listBranches(authOptions, 'nodejs', 'node', function (err, refData) {\n  // data containing branch information including sha and github API url\n  console.log(refData)\n})\n```\n\n### listCommits(auth, org, repo[, options], callback)\n\nList git commits for a repo.\n\nGet all commits for `nodejs/node` repo:\n\n```js\nghrepos.listCommits(authOptions, 'nodejs', 'node', function (err, refData) {\n  // data containing commit information including sha and github API url\n  console.log(refData)\n})\n```\n\n### listTags(auth, org, repo[, options], callback)\n\nList git tags for a repo.\n\nGet all tag for `nodejs/node` repo:\n\n```js\nghrepos.listTags(authOptions, 'nodejs', 'node', function (err, refData) {\n  // data containing tag information including sha and github API url\n  console.log(refData)\n})\n```\n\n### getRef(auth, org, repo, ref[, options], callback)\n\nGet git ref data for a particular ref string.\n\nGet git ref data for `v1.x` branch in `nodejs/node` repo:\n\n```js\nghrepos.getRef(authOptions, 'nodejs', 'node', 'heads/v1.x', function (err, refData) {\n  // data containing ref information including sha and github url\n  console.log(refData)\n})\n```\n\n### getBranch(auth, org, repo, branch[, options], callback)\n\nGet git branch data for a given branch name\n\nGet git branch data for `v1.x` branch in `nodejs/node` repo:\n\n```js\nghrepos.getBranch(authOptions, 'nodejs', 'node', 'v1.x', function (err, refData) {\n  // data containing branch information including sha and github API url\n  console.log(refData)\n})\n```\n\n### getCommit(auth, org, repo, sha1[, options], callback)\n\nGet git commit data for a given sha1\n\nGet git commit data for sha1 `75318e46b` in `nodejs/node` repo:\n\n```js\nghrepos.getCommit(authOptions, 'nodejs', 'node', '75318e46b', function (err, refData) {\n  // data containing commit information including sha and github API url\n  console.log(refData)\n})\n```\n\n### getCommitComments(auth, org, repo, sha1[, options], callback)\n\nGet git commit comments data for a given sha1\n\nGet git commit comments data for sha1 `75318e46b` in `nodejs/node` repo:\n\n```js\nghrepos.getCommitComments(authOptions, 'nodejs', 'node', '75318e46b', function (err, comments) {\n  // array containing commit comments information\n  console.log(JSON.stringify(comments.map(function (i) {\n    return { user: i.user.login, body: i.body }\n  }), null, 2))\n})\n```\n\nYields:\n\n```json\n[\n  {\n    \"user\": \"Trott\",\n    \"body\": \"@cjihrig There's no PR-URL on this commit message. (`core-validate-commit` FTW as usual!)\"\n  },\n  {\n    \"user\": \"mscdex\",\n    \"body\": \"PR-URL is: https://github.com/nodejs/node/pull/15745\"\n  }\n]\n```\n\n### createLister(type)\n\nCreates a function that lists different sub types related to the `'/repos'` api, e.g. list `'issues'`, `'pulls'` or `'releases'`. The function returned has the signature: `function list (auth, org, repo, options, callback)`.\n\n_More methods coming .. as I need them or as you PR them in._\n\n\nThe auth data is compatible with [ghauth](https://github.com/rvagg/ghauth) so you can just connect them together to make a simple command-line application:\n\n```js\nconst ghauth     = require('ghauth')\n    , ghrepos    = require('ghrepos')\n    , authOptions = {\n          configName : 'lister'\n        , scopes     : [ 'user' ]\n      }\n\nghauth(authOptions, function (err, authData) {\n  ghrepos.listUser(authData, 'rvagg', function (err, list) {\n    console.log('Repos for rvagg:')\n    console.log(util.inspect(list.map(function (i) { return {\n        name: i.name\n      , desc: i.description\n      , fork: i.fork\n    }})))\n  })\n})\n```\n\n\n## License\n\n**ghrepos** is Copyright (c) 2015 Rod Vagg [@rvagg](https://github.com/rvagg) and licensed under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.\n","publish_time":1450906458874,"_cnpm_publish_time":1450906458874,"dist-tags":{"latest":"2.1.0"}}