node/deps/npm/node_modules/mkdirp
isaacs 80fb580936 npm: Update to 1.2.14 2013-03-06 15:41:06 -08:00
..
examples npm: Upgrade to 1.1.55 2012-08-21 15:29:37 -07:00
test npm: upgrade to 1.1.41 2012-07-13 12:08:17 -07:00
.npmignore Do not gitignore npm's node_modules 2012-06-11 09:54:39 -07:00
.travis.yml npm: Update to 1.2.14 2013-03-06 15:41:06 -08:00
LICENSE Include NPM, update .pkg to install it. 2011-11-21 10:50:52 -08:00
README.markdown npm: Update to 1.2.14 2013-03-06 15:41:06 -08:00
index.js npm: Upgrade to 1.1.55 2012-08-21 15:29:37 -07:00
package.json npm: Update to 1.2.14 2013-03-06 15:41:06 -08:00

README.markdown

mkdirp

Like mkdir -p, but in node.js!

build status

example

pow.js

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

Output

pow!

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

methods

var mkdirp = require('mkdirp');

mkdirp(dir, mode, cb)

Create a new directory and any necessary subdirectories at dir with octal permission string mode.

If 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.

mkdirp.sync(dir, mode)

Synchronously create a new directory and any necessary subdirectories at dir with octal permission string mode.

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

Returns the first directory that had to be created, if any.

install

With npm do:

npm install mkdirp

license

MIT