Comparing version 3.0.0 to 3.0.1
28
index.js
@@ -7,7 +7,2 @@ 'use strict'; | ||
const defaults = { | ||
mode: 0o777 & (~process.umask()), | ||
fs | ||
}; | ||
const useNativeRecursiveOption = semver.satisfies(process.version, '>=10.12.0'); | ||
@@ -29,2 +24,15 @@ | ||
const processOptions = options => { | ||
// https://github.com/sindresorhus/make-dir/issues/18 | ||
const defaults = { | ||
mode: 0o777 & (~process.umask()), | ||
fs | ||
}; | ||
return { | ||
...defaults, | ||
...options | ||
}; | ||
}; | ||
const permissionError = pth => { | ||
@@ -43,6 +51,3 @@ // This replicates the exception of `fs.mkdir` with native the | ||
checkPath(input); | ||
options = { | ||
...defaults, | ||
...options | ||
}; | ||
options = processOptions(options); | ||
@@ -103,6 +108,3 @@ const mkdir = promisify(options.fs.mkdir); | ||
checkPath(input); | ||
options = { | ||
...defaults, | ||
...options | ||
}; | ||
options = processOptions(options); | ||
@@ -109,0 +111,0 @@ if (useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) { |
{ | ||
"name": "make-dir", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Make a directory and its parents if needed - Think `mkdir -p`", | ||
"license": "MIT", | ||
"repository": "sindresorhus/make-dir", | ||
"funding": "https://github.com/sponsors/sindresorhus", | ||
"author": { | ||
@@ -48,12 +49,12 @@ "name": "Sindre Sorhus", | ||
"@types/graceful-fs": "^4.1.3", | ||
"@types/node": "^11.12.2", | ||
"@types/node": "^13.7.1", | ||
"ava": "^1.4.0", | ||
"codecov": "^3.2.0", | ||
"graceful-fs": "^4.1.15", | ||
"nyc": "^13.3.0", | ||
"nyc": "^15.0.0", | ||
"path-type": "^4.0.0", | ||
"tempy": "^0.2.1", | ||
"tsd": "^0.7.1", | ||
"xo": "^0.24.0" | ||
"tsd": "^0.11.0", | ||
"xo": "^0.25.4" | ||
} | ||
} |
@@ -5,3 +5,2 @@ # make-dir [![Build Status](https://travis-ci.org/sindresorhus/make-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/make-dir) [![codecov](https://codecov.io/gh/sindresorhus/make-dir/branch/master/graph/badge.svg)](https://codecov.io/gh/sindresorhus/make-dir) | ||
## Advantages over [`mkdirp`](https://github.com/substack/node-mkdirp) | ||
@@ -17,3 +16,2 @@ | ||
## Install | ||
@@ -25,3 +23,2 @@ | ||
## Usage | ||
@@ -76,10 +73,9 @@ | ||
## API | ||
### makeDir(path, [options]) | ||
### makeDir(path, options?) | ||
Returns a `Promise` for the path to the created directory. | ||
### makeDir.sync(path, [options]) | ||
### makeDir.sync(path, options?) | ||
@@ -96,7 +92,7 @@ Returns the path to the created directory. | ||
Type: `Object` | ||
Type: `object` | ||
##### mode | ||
Type: `integer`<br> | ||
Type: `integer`\ | ||
Default: `0o777 & (~process.umask())` | ||
@@ -108,3 +104,3 @@ | ||
Type: `Object`<br> | ||
Type: `object`\ | ||
Default: `require('fs')` | ||
@@ -116,3 +112,2 @@ | ||
## Related | ||
@@ -127,5 +122,12 @@ | ||
--- | ||
## License | ||
MIT © [Sindre Sorhus](https://sindresorhus.com) | ||
<div align="center"> | ||
<b> | ||
<a href="https://tidelift.com/subscription/pkg/npm-make-dir?utm_source=npm-make-dir&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a> | ||
</b> | ||
<br> | ||
<sub> | ||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies. | ||
</sub> | ||
</div> |
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
10018
171
126