2.1.0 • Published 10 months ago

which-pm-lockfile v2.1.0

Weekly downloads
10
License
MIT
Repository
github
Last release
10 months ago

If I should maintain this repo, please ⭐️

DM me on Twitter if you have questions or suggestions.


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
  • 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.
  • @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.

MIT - The MIT License