Filesystem.rmrf()

Completely remove a file or directory (like rm -rf).

If the provided path is a directory, all contents will be removed recursively. If nothing exists at the provided path, the success exit will be triggered, but nothing will be deleted.

Usage

Hover over inputs/exits for more info.

var Filesystem = require('machinepack-fs');


// Completely remove a file or directory (like rm -rf).

Filesystem.rmrf({

path: '/Users/mikermcneil/.tmp/foo',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function () {

 

},

});

Inputs

path required

The absolute path to the file or directory to remove.

'/Users/mikermcneil/.tmp/foo'

Exits

error

An unexpected error occurred.

success

OK.