Skip to content

Instantly share code, notes, and snippets.

@garenyondem
Last active December 28, 2017 12:09
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 garenyondem/e2277cfa76dc4f6dd9baabe84e693c99 to your computer and use it in GitHub Desktop.
Save garenyondem/e2277cfa76dc4f6dd9baabe84e693c99 to your computer and use it in GitHub Desktop.
NodeJS Nedir?
{
"Author": "Garen",
"Message": "Hello World"
}
const currentDir = process.cwd();
const fs = require('fs');
(function init() {
let dataFilePath = currentDir + '/data.json';
let encoding = 'utf8';
const callback = (err, content) => {
if (!err) {
console.log(content)
} else {
console.log(err)
}
};
fs.readFile(dataFilePath, encoding, callback);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment