root-pkg-dir
v1.0.0
Published
Find the highest directory with a package.json, starting from from the current working directory.
Downloads
104
Maintainers
Readme
If I should maintain this repo, please ⭐️
DM me on Twitter if you have questions or suggestions.
Installation
npm install root-pkg-dir
yarn add root-pkg-dir
pnpm add root-pkg-dir
bun add root-pkg-dir
Usage
import { rootPkgDir } from "root-pkg-dir";
// Returns an absolute path to the directory of the root package.json
const rootDir = await rootPkgDir(); // string | undefined
Options
type Options {
/**
* The directory to start searching from.
*
* @default process.cwd()
*/
readonly cwd?: URL | string;
};
- root-pkg-json: Find the highest package.json, starting from from the current working directory.
- autorepo: Autorepo abstracts away your dev dependencies, providing a single command to run all of your scripts.