1.1.1 • Published 10 years ago
fs-force-delete v1.1.1
fs-force-delete
Requirements
- Node >= 6.0.0
Usage
var rm = require('fs-force-delete');
rm('foo', (error, info) => {
if (error) {
console.error('Failed', error);
} else {
console.log('Succeed', info);
}
})The code above would check for 'foo' existence,
- If
'foo'doesn't exist,rmdoes nothing - If
'foo'is a file,rmwould deletes that file - If
'foo'is a directory,rmwould recurs itself with children of'foo'and then deletes'foo'