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

x/deno/cli/js/lib.deno_runtime.d.ts>Deno.mkdir

A modern runtime for JavaScript and TypeScript.
Go to Latest
function Deno.mkdir
import { Deno } from "https://deno.land/x/deno@v0.28.0/cli/js/lib.deno_runtime.d.ts";
const { mkdir } = Deno;

Creates a new directory with the specified path. If recursive is set to true, nested directories will be created (also known as "mkdir -p"). mode sets permission bits (before umask) on UNIX and does nothing on Windows.

  await Deno.mkdir("new_dir");
  await Deno.mkdir("nested/directories", true);

Parameters

path: string
optional
recursive: boolean
optional
mode: number

Returns

Promise<void>