Small utilities for resolving paths in Deno with a simpler developer experience.
- 🧭 Resolve paths relative to the current working directory
- 📁 Resolve paths relative to the current module
- ⚡ Built specifically for Deno
- 🧩 Re-exports utilities from
@std/path - 🪶 Tiny, simple, and dependency-light
-
Deno:
deno add jsr:@dep/path
Resolve a path relative to the current working directory.
import { useCwd } from "@dep/path";
const configPath = useCwd("config", "app.json");
console.log(configPath);
// /project/config/app.jsonResolve a path relative to the directory of the current module.
import { useDirname } from "@dep/path";
const configPath = useDirname(import.meta, "config.json");
console.log(configPath);
// /project/src/config.jsonThis package re-exports everything from @std/path.
import { basename, join } from "@dep/path";
const file = join("src", "main.ts");
console.log(basename(file));
// main.tsMIT License – see LICENSE for details.
Author: Estarlin R (estarlincito.com)