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

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

A modern runtime for JavaScript and TypeScript.
Latest
function Deno.cwd
allow-read
import { Deno } from "https://deno.land/x/deno@v2.0.4/cli/tsc/dts/lib.deno.ns.d.ts";
const { cwd } = Deno;

Return a string representing the current working directory.

If the current directory can be reached via multiple paths (due to symbolic links), cwd() may return any one of them.

const currentWorkingDirectory = Deno.cwd();

Throws Deno.errors.NotFound if directory not available.

Requires allow-read permission.

Returns

string