Skip to content

Instantly share code, notes, and snippets.

@debonx
Created January 19, 2020 19:22
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 debonx/7f42746c53f0523254b6e67b82f16c61 to your computer and use it in GitHub Desktop.
Save debonx/7f42746c53f0523254b6e67b82f16c61 to your computer and use it in GitHub Desktop.
Node: Filesystem core module.
const fs = require('fs');
let readDataCallback = (err, data) => {
if (err) {
console.log(`Something went wrong: ${err}`);
} else {
console.log(`Provided file contained: ${data}`);
}
};
fs.readFile('./finalFile.txt', 'utf-8', readDataCallback);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment