npm.io
1.0.2 • Published 3 years ago

root-pkg-json

Licence
MIT
Version
1.0.2
Deps
1
Size
5 kB
Vulns
0
Weekly
0
Stars
1

root-pkg-json

NPM TypeScript

Find the highest package.json, starting from from the current working directory.

If I should maintain this repo, please ️ GitHub stars

DM me on Twitter if you have questions or suggestions. Twitter


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;
};

Dependenciesdependencies

  • locate-path: Get the first path that exists on disk of multiple paths

Dev Dependencies

  • autorepo: Autorepo abstracts away your dev dependencies, providing a single command to run all of your scripts.

License license

MIT

Keywords