Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 62 lines (39 sloc) 1.19 kb
009faa8 @substack readme and an example
authored
1 mkdirp
2 ======
3
4 Like `mkdir -p`, but in node.js!
5
7b422c7 @substack travis badge
authored
6 [![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)
7
a710725 @substack document the methods including the new mkdir.sync
authored
8 example
009faa8 @substack readme and an example
authored
9 =======
10
11 pow.js
12 ------
6c45c85 @substack module.exports = mkdirp
authored
13 var mkdirp = require('mkdirp');
009faa8 @substack readme and an example
authored
14
0384932 @substack documented default umask modes and a bump
authored
15 mkdirp('/tmp/foo/bar/baz', function (err) {
009faa8 @substack readme and an example
authored
16 if (err) console.error(err)
17 else console.log('pow!')
18 });
19
20 Output
21 pow!
22
23 And now /tmp/foo/bar/baz exists, huzzah!
a710725 @substack document the methods including the new mkdir.sync
authored
24
25 methods
26 =======
27
28 var mkdirp = require('mkdirp');
29
30 mkdirp(dir, mode, cb)
31 ---------------------
32
33 Create a new directory and any necessary subdirectories at `dir` with octal
34 permission string `mode`.
35
0384932 @substack documented default umask modes and a bump
authored
36 If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
37
59598d2 @substack bump and document the `made` param
authored
38 `cb(err, made)` fires with the error or the first directory `made`
39 that had to be created, if any.
40
a710725 @substack document the methods including the new mkdir.sync
authored
41 mkdirp.sync(dir, mode)
42 ----------------------
43
44 Synchronously create a new directory and any necessary subdirectories at `dir`
45 with octal permission string `mode`.
46
0384932 @substack documented default umask modes and a bump
authored
47 If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
48
59598d2 @substack bump and document the `made` param
authored
49 Returns the first directory that had to be created, if any.
50
a710725 @substack document the methods including the new mkdir.sync
authored
51 install
52 =======
53
54 With [npm](http://npmjs.org) do:
55
56 npm install mkdirp
57
58 license
59 =======
60
61 MIT/X11
Something went wrong with that request. Please try again.