Answers for "Which function(s) can be used to delete a file in js ?"

5

javascript delete file

const fs = require('fs')

const path = './file.txt'

try {
  fs.unlinkSync(path)
  //file removed
} catch(err) {
  console.error(err)
}
Posted by: Guest on July-02-2020

Code answers related to "Which function(s) can be used to delete a file in js ?"

Code answers related to "Javascript"

Browse Popular Code Answers by Language