Skip to content

Commit

Permalink
Replace mkdirp with fs.mkdir with recursive flag (#1291)
Browse files Browse the repository at this point in the history
Ref https://nodejs.org/dist/latest-v10.x/docs/api/fs.html#fs_fs_mkdir_path_options_callback

Node 10 add "recursive" flag support to fs.mkdir which behaves similar
to mkdirp package.

Though this requires to bump node support.
  • Loading branch information
TrySound committed Feb 13, 2021
1 parent 5f1d593 commit 4a08c6d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
@@ -1,10 +1,9 @@
language: node_js

node_js:
- 6
- 8
- 10
- 12
- 14

branches:
only:
Expand Down
3 changes: 1 addition & 2 deletions lib/svgo/coa.js
Expand Up @@ -4,7 +4,6 @@
var FS = require('fs'),
PATH = require('path'),
chalk = require('chalk'),
mkdirp = require('mkdirp'),
promisify = require('util.promisify'),
readdir = promisify(FS.readdir),
readFile = promisify(FS.readFile),
Expand Down Expand Up @@ -490,7 +489,7 @@ function writeOutput(input, output, data) {
return Promise.resolve();
}

mkdirp.sync(PATH.dirname(output));
FS.mkdirSync(PATH.dirname(output), { recursive: true });

return writeFile(output, data, 'utf8').catch(error => checkWriteFileError(input, output, data, error));
}
Expand Down
4 changes: 3 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -55,7 +55,6 @@
"css-tree": "1.0.0-alpha.37",
"csso": "^4.0.2",
"js-yaml": "^3.13.1",
"mkdirp": "~0.5.1",
"sax": "~1.2.4",
"stable": "^0.1.8",
"unquote": "~1.1.1",
Expand All @@ -72,7 +71,7 @@
"should": "~13.2.3"
},
"engines": {
"node": ">=4.0.0"
"node": ">=10.12.0"
},
"license": "MIT"
}

0 comments on commit 4a08c6d

Please sign in to comment.