MCPcopy Index your code
hub / github.com/nodejs/node / mkdir

Function mkdir

lib/internal/fs/promises.js:1589–1615  ·  view source on GitHub ↗
(path, options)

Source from the content-addressed store, hash-verified

1587}
1588
1589async function mkdir(path, options) {
1590 const h = vfsState.handlers;
1591 if (h !== null) {
1592 const promise = h.mkdir(path, options);
1593 if (promise !== undefined) return (await promise).result;
1594 }
1595 if (typeof options === 'number' || typeof options === 'string') {
1596 options = { mode: options };
1597 }
1598 const {
1599 recursive = false,
1600 mode = 0o777,
1601 } = options || kEmptyObject;
1602 path = getValidatedPath(path);
1603 validateBoolean(recursive, 'options.recursive');
1604
1605 return await PromisePrototypeThen(
1606 binding.mkdir(
1607 path,
1608 parseFileMode(mode, 'mode', 0o777),
1609 recursive,
1610 kUsePromises,
1611 ),
1612 undefined,
1613 handleErrorFromBinding,
1614 );
1615}
1616
1617async function readdirRecursive(originalPath, options) {
1618 const result = [];

Callers 7

test-esm-json.mjsFile · 0.90
setupFunction · 0.90
test-fs-glob.mjsFile · 0.90
checkParentDirFunction · 0.50
mkDirAndCopyFunction · 0.50

Calls 2

parseFileModeFunction · 0.85
mkdirMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…