less-mkdirpdeprecated

Recursively mkdir, like `mkdir -p`

Usage no npm install needed!

<script type="module">
  import lessMkdirp from 'https://cdn.skypack.dev/less-mkdirp';
</script>

README

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