Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/cli/dts/lib.deno.ns.d.ts>Deno.mkdir

A modern runtime for JavaScript and TypeScript.
Go to Latest
function Deno.mkdir
allow-write
import { Deno } from "https://deno.land/x/deno@v1.28.0/cli/dts/lib.deno.ns.d.ts";
const { mkdir } = Deno;

Creates a new directory with the specified path.

await Deno.mkdir("new_dir");
await Deno.mkdir("nested/directories", { recursive: true });
await Deno.mkdir("restricted_access_dir", { mode: 0o700 });

Defaults to throwing error if the directory already exists.

Requires allow-write permission.

Parameters

path: string | URL
optional
options: MkdirOptions

Returns

Promise<void>