From 2fa959d2cca82ea9711e7845004337e08bcff390 Mon Sep 17 00:00:00 2001 From: Bogdan Chadkin Date: Fri, 2 Oct 2020 23:11:02 +0300 Subject: [PATCH 1/2] Replace mkdirp with fs.mkdir with recursive flag 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. --- .travis.yml | 3 +-- lib/svgo/coa.js | 3 +-- package-lock.json | 4 +++- package.json | 3 +-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index a596238a2..6ad49506a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,9 @@ language: node_js node_js: - - 6 - - 8 - 10 - 12 + - 14 branches: only: diff --git a/lib/svgo/coa.js b/lib/svgo/coa.js index 1ac62ad1e..7fa1079d2 100644 --- a/lib/svgo/coa.js +++ b/lib/svgo/coa.js @@ -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), @@ -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)); } diff --git a/package-lock.json b/package-lock.json index cbc3e0b8e..c78003d08 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1046,12 +1046,14 @@ "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, "requires": { "minimist": "0.0.8" } diff --git a/package.json b/package.json index f538c765c..bc451c12d 100644 --- a/package.json +++ b/package.json @@ -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", @@ -72,7 +71,7 @@ "should": "~13.2.3" }, "engines": { - "node": ">=4.0.0" + "node": ">=10.0.0" }, "license": "MIT" } From ce3a33b57b09f3d4c47b1fd18dc4f0ba1bc2fe36 Mon Sep 17 00:00:00 2001 From: Bogdan Chadkin Date: Fri, 13 Nov 2020 17:27:56 +0300 Subject: [PATCH 2/2] Bump node version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bc451c12d..8dde66f6a 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "should": "~13.2.3" }, "engines": { - "node": ">=10.0.0" + "node": ">=10.12.0" }, "license": "MIT" }