This package has been deprecated

Author message:

Use fs.mkdir with recursive: true instead, or the mkdirp2 package on older versions of Node

less-mkdirp

1.0.1 • Public • Published

mkdirp

Like mkdir -p, but in node.js!

build status

example

pow.js

var mkdirp = require('less-mkdirp');

mkdirp('/tmp/foo/bar/baz', function (error) {
    if (error) {
        console.error(err);
    } else {
        console.log('pow!');
    }
});

Output

pow!

And now /tmp/foo/bar/baz exists, huzzah!

methods

var mkdirp = require('less-mkdirp');

mkdirp(path, [options], callback)

Create a new directory and any necessary subdirectories at path with octal permission string options.mode. If options is a non-object, it will be treated as the options.mode.

If options.mode isn't specified, it defaults to 0777 & (~process.umask()).

cb(err, made) fires with the error or the first directory made that had to be created, if any.

You can optionally pass in an alternate fs implementation by passing in options.fs. Your implementation should have options.fs.mkdir(path, mode, cb) and options.fs.stat(path, cb).

install

With npm do:

npm install less-mkdirp

license

MIT

Readme

Keywords

Package Sidebar

Install

npm i less-mkdirp

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • charmander