Skip to content

Instantly share code, notes, and snippets.

@cacheflow
Last active January 19, 2016 23:35
Show Gist options
  • Save cacheflow/38ed4cfbe34598e9b898 to your computer and use it in GitHub Desktop.
Save cacheflow/38ed4cfbe34598e9b898 to your computer and use it in GitHub Desktop.
var fetch = require('node-fetch');
var url = "running before everything else";
fetch('https://api.github.com/users/jmsevold')
.then(function(res) {
return res.json();
}).then(function(result) {
url = result.followers_url
return url;
}).then(function(url){
fetch(url).then(function(res){
return res.json();
}).then(function(json){
url = json;
console.log("this is the json data stored in the url being called later", url);
return json;
}).catch(function (error) {
console.log(error);
});
}).catch(function (error) {
console.log(error);
});
console.log(url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment