Skip to content

Instantly share code, notes, and snippets.

@PantherHawk
Last active March 4, 2017 05:08
Show Gist options
  • Save PantherHawk/088b5d9f0e72f642bec9fbef8261c66c to your computer and use it in GitHub Desktop.
Save PantherHawk/088b5d9f0e72f642bec9fbef8261c66c to your computer and use it in GitHub Desktop.
// A S Y N C H R O N O U S FXN USING A C A L L B A C K
var fetchFile = function(filePath, callback) {
readFile(filePath, (err, contents) => {
if (err) {
return callback(err);
} else {
callback(contents);
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment