Answers for "node js open nodejs"

7

nodejs readfile

const fs = require('fs');

fs.readFile('/Users/joe/test.txt', 'utf8' , (err, data) => {
  if (err) {
    console.error(err);
    return
  }
  console.log(data);
});
Posted by: Guest on August-30-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language