root-pkg-json
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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

Package Sidebar

Install

npm i root-pkg-json

Weekly Downloads

7

Version

1.0.2

License

MIT

Unpacked Size

4.76 kB

Total Files

4

Last publish

Collaborators

  • bconnorwhite