npm.io
1.0.0 • Published 3 years ago

root-pkg-dir

Licence
MIT
Version
1.0.0
Deps
1
Size
4 kB
Vulns
0
Weekly
0
Stars
1

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

Keywords