mirror of
https://github.com/all-contributors/cli.git
synced 2025-01-10 14:06:34 +00:00
17 lines
350 B
JavaScript
17 lines
350 B
JavaScript
'use strict';
|
|
|
|
var request = require('request');
|
|
|
|
module.exports = function getUserInfo(username, cb) {
|
|
request.get({
|
|
url: 'https://api.github.com/users/' + username,
|
|
headers: {
|
|
'User-Agent': 'request'
|
|
}
|
|
}, function(error, res) {
|
|
if (error) {
|
|
return cb(error);
|
|
}
|
|
return cb(null, JSON.parse(res.body));
|
|
});
|
|
}
|