node-fs-extra/docs/remove.md
2017-03-08 21:58:11 -08:00

386 B

remove(dir, callback)

Removes a file or directory. The directory can have contents. Like rm -rf.

  • dir <String>
  • callback <Function>

Example:

const fs = require('fs-extra')

fs.remove('/tmp/myfile', err => {
  if (err) return console.error(err)

  console.log('success!')
})

fs.removeSync('/home/jprichardson') // I just deleted my entire HOME directory.