Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@charlenetshos
Last active March 17, 2023 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save charlenetshos/9316c378ae28bf57ba2ee04bcf6d21c7 to your computer and use it in GitHub Desktop.
Save charlenetshos/9316c378ae28bf57ba2ee04bcf6d21c7 to your computer and use it in GitHub Desktop.
Asynchronous Node
const fs = require('fs');
console.log('About to read file content');
fs.readFile('file.md', 'utf-8', function (err, content) {
if (err) {
return console.log(err);
}
console.log('Done reading file');
console.log(content);
});
console.log('Node.js is based on JS.');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment