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

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

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

Change the current working directory to the specified path.

  Deno.chdir("/home/userA");
  Deno.chdir("../userB");
  Deno.chdir("C:\\Program Files (x86)\\Java");

Throws Deno.errors.NotFound if directory not found. Throws Deno.errors.PermissionDenied if the user does not have access rights

Requires --allow-read.

Parameters

directory: string