Comparing version 0.2.1 to 0.2.2
var mkdirp = require('mkdirp'); | ||
mkdirp('/tmp/foo/bar/baz', 0755, function (err) { | ||
mkdirp('/tmp/foo/bar/baz', function (err) { | ||
if (err) console.error(err) | ||
else console.log('pow!') | ||
}); |
@@ -7,3 +7,6 @@ var path = require('path'); | ||
function mkdirP (p, mode, f) { | ||
if (mode === undefined) throw new Error('mode not specified'); | ||
if (typeof mode === 'function' || mode === undefined) { | ||
f = mode; | ||
mode = 0777 & (~process.umask()); | ||
} | ||
@@ -42,3 +45,5 @@ var cb = f || function () {}; | ||
mkdirP.sync = function sync (p, mode) { | ||
if (mode === undefined) throw new Error('mode not specified'); | ||
if (mode === undefined) { | ||
mode = 0777 & (~process.umask()); | ||
} | ||
@@ -45,0 +50,0 @@ if (typeof mode === 'string') mode = parseInt(mode, 8); |
{ | ||
"name" : "mkdirp", | ||
"description" : "Recursively mkdir, like `mkdir -p`", | ||
"version" : "0.2.1", | ||
"version" : "0.2.2", | ||
"author" : "James Halliday <mail@substack.net> (http://substack.net)", | ||
@@ -6,0 +6,0 @@ "main" : "./index", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15540
20
373
55
11