mkdirp
and make-dir
can often be replaced with built-in Node APIs.
Node.js v10.0 and up supports the recursive
option in the fs.mkdir
function, which
allows parent directories to be created automatically:
import {mkdir} from 'node:fs/promises';
import {mkdirSync} from 'node:fs';
await mkdir('some/nested/path', {recursive: true});
mkdirSync('some/nested/path', {recursive: true});