mirror of
https://github.com/jprichardson/node-fs-extra.git
synced 2026-01-25 16:42:57 +00:00
21 lines
386 B
Markdown
21 lines
386 B
Markdown
# remove(dir, callback)
|
|
|
|
Removes a file or directory. The directory can have contents. Like `rm -rf`.
|
|
|
|
- `dir` `<String>`
|
|
- `callback` `<Function>`
|
|
|
|
## Example:
|
|
|
|
```js
|
|
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.
|
|
```
|