4 Like `mkdir -p`, but in node.js!
6 [![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)
13 var mkdirp = require('mkdirp');
15 mkdirp('/tmp/foo/bar/baz', function (err) {
16 if (err) console.error(err)
17 else console.log('pow!')
23 And now /tmp/foo/bar/baz exists, huzzah!
28 var mkdirp = require('mkdirp');
33 Create a new directory and any necessary subdirectories at `dir` with octal
34 permission string `mode`.
36 If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
38 `cb(err, made)` fires with the error or the first directory `made`
39 that had to be created, if any.
41 mkdirp.sync(dir, mode)
42 ----------------------
44 Synchronously create a new directory and any necessary subdirectories at `dir`
45 with octal permission string `mode`.
47 If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
49 Returns the first directory that had to be created, if any.
54 With [npm](http://npmjs.org) do: