which-pm-lockfile
v2.1.0
Published
Check if a project uses yarn, npm, or pnpm
Downloads
43
Maintainers
Readme
If I should maintain this repo, please ⭐️
DM me on Twitter if you have questions or suggestions.
Installation
npm install which-pm-lockfileyarn add which-pm-lockfilepnpm add which-pm-lockfilebun add which-pm-lockfileUsage
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
