Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

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

A modern runtime for JavaScript and TypeScript.
Go to Latest
function Deno.cwd
import { Deno } from "https://deno.land/x/deno@v1.0.0/cli/js/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

Returns

string