- readFile
Read file
examples/fs/read_file.js
const fs = require('fs'); fs.readFile('data.txt', 'utf8', (err, content) => { if (err) { console.log(err); } else { console.log(content); } });
const fs = require('fs'); fs.readFile('data.txt', 'utf8', (err, content) => { if (err) { console.log(err); } else { console.log(content); } });