在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:Jam3/gh-api-stream开源软件地址:https://github.com/Jam3/gh-api-stream开源编程语言:JavaScript 100.0%开源软件介绍:gh-api-streamStreams paginated JSON from a GitHub API. var api = require('gh-api-stream')
// prints all my follower's usernames
api('/users/mattdesl/followers')
.on('data', function (follower) {
console.log(follower.login)
}) For a non-streamed and browser-friendly alternative, see gh-api. Installnpm install gh-api-stream ExamplesBelow is an example of paging through all var api = require('gh-api-stream')
var ghauth = require('ghauth')
ghauth({
configName: 'my-test',
scopes: ['user', 'repo']
}, function (err, data) {
if (err) throw err
api('/repos/mattdesl/budo/issues', {
query: {
state: 'open'
},
token: data.token,
rows: true
}).on('data', function (issue) {
console.log(issue.title)
}).on('end', function () {
console.log("Done!")
})
}) See test/example.js for another example. Usage
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论