find-root-kt
v1.0.7
Published
Tiny utility to locate the project root (Node/Bun ESM-friendly).
Maintainers
Readme
find-root-kt
Find the project root directory for Node.js / Bun projects by walking up from the current module location.
Package name: find-root-kt
Purpose: small, zero-dependency utility to reliably locate the project's root directory (the directory you would treat as “project root”, typically containing a package.json, .git etc.). Designed for ESM runtimes (Node, Bun) and tool authors.
Features
- Tiny and zero-dependency
- Works in ESM runtimes (Node.js, Bun)
- Returns an absolute path to the detected project root
- Caches result for performance (can be bypassed)
- Produces TypeScript declarations
Install
# npm
npm install find-root-kt
# yarn
yarn add find-root-kt
# bun
bun add find-root-ktexample
import findRoot from "find-root-kt";
const root = await findRoot();
console.log("project root:", root);
