Filesystem.ensureDir()

Ensure that the directory exists. If the directory structure does not exist, it is created.

Usage

Hover over inputs/exits for more info.

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


// Ensure that the directory exists. If the directory structure does not exist, it is created.

Filesystem.ensureDir({

path: '/foo/bar/baz',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function () {

 

},

});

Inputs

path required

The path to ensure- if nothing exists, a directory will be created here.

'/foo/bar/baz'

Exits

error

An unexpected error occurred.

success

OK.