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