Skip to content

Instantly share code, notes, and snippets.

@bulkan
Last active August 29, 2015 14:00
Show Gist options
  • Save bulkan/11359213 to your computer and use it in GitHub Desktop.
Save bulkan/11359213 to your computer and use it in GitHub Desktop.
var request = require('request')
, Promise = require('bluebird')
, getAsync = Promise.promisify(request.get);
module.exports.getProfile = function getProfile(username) {
return getAsync('https://api.github.com/users/' + username);
}
{
"name": "mocking_demo",
"version": "0.0.0",
"description": "",
"main": "gh.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://gist.github.com/11359213.git"
},
"author": "Bulkan Evcimen <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://gist.github.com/11359213"
},
"homepage": "https://gist.github.com/11359213",
"dependencies": {
"bluebird": "^1.2.4",
"chai": "^1.9.1",
"sinon": "^1.9.1",
"request": "^2.34.0",
"mocha": "^1.18.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment