Skip to content

Replace mkdirp with native fs.mkdirSync({ recursive: true })#1384

Merged
sanex3339 merged 1 commit intojavascript-obfuscator:masterfrom
roli-lpci:fix/remove-mkdirp-native-fs
Mar 22, 2026
Merged

Replace mkdirp with native fs.mkdirSync({ recursive: true })#1384
sanex3339 merged 1 commit intojavascript-obfuscator:masterfrom
roli-lpci:fix/remove-mkdirp-native-fs

Conversation

@roli-lpci
Copy link
Copy Markdown
Contributor

Summary

  • Remove mkdirp (3.0.1) dependency and @types/mkdirp (1.0.2) devDependency
  • Replace all usages with Node's built-in fs.mkdirSync(path, { recursive: true })
  • Update test files that used mkdirp.sync() for test directory setup

Motivation

mkdirp is a micro-dependency that wraps functionality available natively in Node.js since v10.12.0.
Since this project requires node >=18.0.0, the native API is always available.

Removing mkdirp reduces the dependency count and attack surface with zero behavior change.

Closes #1275

Test plan

  • All 27 ObfuscatedCodeFileUtils unit tests pass
  • All 16 SourceCodeFileUtils unit tests pass
  • All 8 IdentifierNamesCacheFileUtils unit tests pass
  • All 85 CLI functional tests pass
  • ESLint passes clean

Remove the mkdirp dependency in favor of Node's built-in
fs.mkdirSync with the recursive option, which has been available
since Node 10.12 (repo requires >=18.0.0).

Closes javascript-obfuscator#1275

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sanex3339
Copy link
Copy Markdown
Member

Thank you!

@sanex3339 sanex3339 merged commit 1aadbac into javascript-obfuscator:master Mar 22, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace mkdirp with fs.mkdirSync(path, { recursive: true })

2 participants