deno_std icon indicating copy to clipboard operation
deno_std copied to clipboard

path.resolve depends on cwd

Open ry opened this issue 4 years ago • 3 comments

Many applications still want path resolving functionality without this dependency.

Ref https://github.com/denoland/deno_std/pull/685 Ref #643

ry avatar Aug 16 '21 08:08 ry

I think we should fix this before Std. Lib. reaching stability. Do we have any ideas on how this can be solved?

iuioiua avatar Dec 03 '23 23:12 iuioiua

path.resolve can be used for getting cwd:

import { resolve, dirname } from "https://deno.land/[email protected]/path/mod.ts";
const resolved = resolve("foo");
console.log(resolved);
const cwd = dirname(resolved);
console.log(cwd);

What is the expected permission requirement for path.resolve?

kt3k avatar Dec 04 '23 06:12 kt3k

IIUC it's for std/path functions, not to require any permissions. Right now, it requires --allow-read permissions. #685 had the interesting idea of having a fs.resolvePath(), which does require --allow-read permissions, but expectedly so.

iuioiua avatar Dec 04 '23 06:12 iuioiua