Answers for "fs unlink"

2

fs.unlink

fs.unlink(“fileName”, function (err) {
  if (err) throw err;
  console.log(delete!');
});
Posted by: Guest on October-19-2021
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
0

fs readfile encoding

fs.readFile('/etc/passwd', 'utf8', callback);
Posted by: Guest on April-17-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language