Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
console.log('start');
const fs = require('fs');
var data = '';
fs.readFile('test.txt', (err, result) => {
if (err) {
throw err;
} else {
console.log('complete now')
data = result;
}
});
console.log('end');
# output
# ----------
# start
# end
# complete now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.