node-github 是 Node.js 对 Github 开放 API 的封装库。
安装:
$ npm install github
使用方法:
var GitHubApi = require("github"); var github = new GitHubApi({ // required version: "3.0.0", // optional debug: true, protocol: "https", host: "github.my-GHE-enabled-company.com", pathPrefix: "/api/v3", // for some GHEs timeout: 5000 }); github.user.getFollowingFromUser({ // optional: // headers: { // "cookie": "blahblah" // }, user: "mikedeboer" }, function(err, res) { console.log(JSON.stringify(res)); });