Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 628 Bytes

mkdirp.md

File metadata and controls

19 lines (13 loc) · 628 Bytes

mkdirp / make-dir

mkdirp and make-dir can often be replaced with built-in Node APIs.

Alternatives

NodeJS (since v10.x)

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});