which-pm-lockfile
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

which-pm-lockfile

npm typescript Coveralls Status

Get the path to a project's npm, yarn, pnpm, or bun lockfile.

If I should maintain this repo, please ⭐️ GitHub stars

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


Installation

npm install which-pm-lockfile
yarn add which-pm-lockfile
pnpm add which-pm-lockfile
bun add which-pm-lockfile

Usage

import {
  getPackageManagerName,
  getLockfile,
  getLockfilePath,
  hasNPM,
  hasYarn,
  hasPNPM,
  hasBun
} from "which-pm-lockfile";

const pmName = await getPackageManagerName(); // "npm" | "yarn" | "pnpm" | "bun"

const lockfile = await getLockfile(); // "package-lock.json" | "yarn.lock" | "shrinkwrap.yaml" | "bun.lockb"

const npm = await hasNPM(); // true | false
const yarn = await hasYarn(); // true | false
const pnpm = await hasPNPM(); // true | false
const bun = await hasBun(); // true | false

Dependenciesdependencies

  • file-structure: Define and manage file structures
  • root-pkg-dir: Find the highest directory with a package.json, starting from from the current working directory.

Dev Dependencies

  • @types/mock-fs: TypeScript definitions for mock-fs
  • autorepo: Autorepo abstracts away your dev dependencies, providing a single command to run all of your scripts.
  • mock-fs: A configurable mock file system. You know, for testing.

License license

MIT - The MIT License

Dependencies (2)

Dev Dependencies (3)

Package Sidebar

Install

npm i which-pm-lockfile

Weekly Downloads

18

Version

2.1.0

License

MIT

Unpacked Size

8.1 kB

Total Files

4

Last publish

Collaborators

  • bconnorwhite