Created
September 24, 2018 21:18
-
-
Save jaylandro/e021165ab42dd021dd3c371473a9a70a to your computer and use it in GitHub Desktop.
Follow sample append
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const request = require('request'); | |
const fs = require('fs'); | |
request('https://api.github.com/users/jaylandro/followers', {headers: { | |
'Accept': 'application/json', | |
'Accept-Charset': 'utf-8', | |
'User-Agent': 'my-app' | |
}}, (err, res, body) => { | |
if (err) { return console.log(err); } | |
fs.appendFile('people.txt', body, function (err) { | |
if (err) throw err; | |
console.log('Saved!'); | |
console.log(body); | |
// console.log(body.explanation); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment