stabilize Deno.cwd and require --allow-read (#5068)

This commit is contained in:
Ryan Dahl 2020-05-04 14:23:06 -04:00 committed by GitHub
parent 191c59a591
commit 6c02b061ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 23 additions and 59 deletions

View file

@ -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,