Skip to content

Instantly share code, notes, and snippets.

@ebramanti
Created February 18, 2016 01:33
Show Gist options
  • Save ebramanti/db42d7b9e32d8692d181 to your computer and use it in GitHub Desktop.
Save ebramanti/db42d7b9e32d8692d181 to your computer and use it in GitHub Desktop.
const requestFromLinkInFile = Promise.coroutine(function*() {
const url = yield fs.readFile('link.txt');
const response = yield request.get(url);
return response.body ? response.body : 'No body returned from request.';
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment