Skip to content

Instantly share code, notes, and snippets.

@Freyert
Created December 29, 2015 21:37
Show Gist options
  • Select an option

  • Save Freyert/b327abc4bd5a0de0a495 to your computer and use it in GitHub Desktop.

Select an option

Save Freyert/b327abc4bd5a0de0a495 to your computer and use it in GitHub Desktop.
var fs = require('fs');
function readFile(path, options) {
return new Promise(function(resolve, reject) {
fs.readFile(path, options, function(err, data) {
if(err) { reject(err); }
else {
resolve(data);
}
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment