nx.js
NamespacesSwitchFunctions

mkdir

mkdir(path, mode): Promise<number>

Creates the directory at the provided path, as well as any necessary parent directories.

Parameters

ParameterTypeDefault valueDescription
pathPathLikeundefinedPath of the directory to create.
modenumber0o777The file mode to set for the directories. Default: 0o777.

Returns

Promise<number>

A Promise which resolves to the number of directories created. If the directory already exists, resolves to 0.

Example

const count = await Switch.mkdir('sdmc:/foo/bar/baz');
console.log(`Created ${count} directories`);
// Created 3 directories

On this page