Path.mkdirSync() method
pathlib-ts > Path > mkdirSync
Path.mkdirSync() method
Section titled “Path.mkdirSync() method”Create a directory synchronously with optional parents and existOk.
Signature:
mkdirSync(options?: { parents?: boolean; existOk?: boolean; mode?: number; }): void;Parameters
Section titled “Parameters”|
Parameter |
Type |
Description |
|---|---|---|
|
options |
{ parents?: boolean; existOk?: boolean; mode?: number; } |
(Optional) POSIX-style creation options ( |
Returns:
void
Remarks
Section titled “Remarks”Mirrors Path.mkdir() but executes synchronously.
Example
Section titled “Example”Preparing output directories synchronously
import { Path } from "pathlib-ts";
const outDir = new Path("./dist/assets");outDir.mkdirSync({ parents: true, existOk: true });