From 143d1105a8850556afead4f19ac6108cbae407e9 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Wed, 21 Jun 2023 18:09:59 +0300 Subject: [PATCH] fix: Remove dependency on mkdirp This dependency does not work in a browser. Node 10+ includes the recursive parameter for mkdirSync --- packages/core/package.json | 1 - packages/core/src/index.js | 3 +-- yarn.lock | 5 ----- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index b2d5d674d..eec2bce13 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -35,7 +35,6 @@ "exif-parser": "^0.1.12", "file-type": "^16.5.4", "isomorphic-fetch": "^3.0.0", - "mkdirp": "^2.1.3", "pixelmatch": "^4.0.2", "tinycolor2": "^1.6.0" }, diff --git a/packages/core/src/index.js b/packages/core/src/index.js index 01231449f..0f542bf45 100755 --- a/packages/core/src/index.js +++ b/packages/core/src/index.js @@ -4,7 +4,6 @@ import EventEmitter from "events"; import { isNodePattern, throwError, scan, scanIterator } from "@jimp/utils"; import anyBase from "any-base"; -import mkdirp from "mkdirp"; import pixelMatch from "pixelmatch"; import tinyColor from "tinycolor2"; @@ -522,7 +521,7 @@ class Jimp extends EventEmitter { const pathObj = Path.parse(path); if (pathObj.dir) { - mkdirp.sync(pathObj.dir); + fs.mkdirSync(pathObj.dir, { recursive: true }); } this.getBuffer(mime, (err, buffer) => { diff --git a/yarn.lock b/yarn.lock index de127e58a..00694facb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8423,11 +8423,6 @@ mkdirp@^1.0.3: resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -mkdirp@^2.1.3: - version "2.1.3" - resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-2.1.3.tgz#b083ff37be046fd3d6552468c1f0ff44c1545d1f" - integrity sha512-sjAkg21peAG9HS+Dkx7hlG9Ztx7HLeKnvB3NQRcu/mltCVmvkF0pisbiTSfDVYTT86XEfZrTUosLdZLStquZUw== - mocha@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-6.2.0.tgz#f896b642843445d1bb8bca60eabd9206b8916e56"