Skip to content

dep-ts/path

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@dep/path 🧭

Small utilities for resolving paths in Deno with a simpler developer experience.

JSR version

Features ✨

  • 🧭 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

Installation 📦

  • Deno:

    deno add jsr:@dep/path

Usage 🎯

API 🧩

useCwd

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.json

useDirname

Resolve 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.json

Using @std/path utilities

This package re-exports everything from @std/path.

import { basename, join } from "@dep/path";

const file = join("src", "main.ts");

console.log(basename(file));
// main.ts

License 📄

MIT License – see LICENSE for details.

Author: Estarlin R (estarlincito.com)

About

Small utilities for resolving paths in Deno with a simpler developer experience.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors