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

1.0.0 • Public • Published

root-pkg-dir

NPM TypeScript

Find the highest directory with a 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-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;
};

Dependenciesdependencies

  • root-pkg-json: Find the highest package.json, starting from from the current working directory.

Dev Dependencies

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

License license

MIT

/root-pkg-dir/

    Package Sidebar

    Install

    npm i root-pkg-dir

    Weekly Downloads

    8

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    4.14 kB

    Total Files

    4

    Last publish

    Collaborators

    • bconnorwhite