From 6c02b061ce157b9fc3d20f9bcace0bc6638290d3 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 4 May 2020 14:23:06 -0400 Subject: stabilize Deno.cwd and require --allow-read (#5068) --- cli/js/lib.deno.ns.d.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'cli/js/lib.deno.ns.d.ts') diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts index 45730acbc..6adaf26ef 100644 --- a/cli/js/lib.deno.ns.d.ts +++ b/cli/js/lib.deno.ns.d.ts @@ -144,6 +144,20 @@ declare namespace Deno { */ export function chdir(directory: string): void; + /** + * 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 + */ + export function cwd(): string; + export enum SeekMode { Start = 0, Current = 1, -- cgit v1.2.3