Lightweight script to detect which package manager executes the current process.
Currently, only the package manager bun, npm, yarn and pnpm are supported.
Use your favorite package manager to install used-pm. For example:
npm install used-pmor
yarn add used-pmor
pnpm add used-pmor
bun add used-pmIn esm:
import currentPackageManager from 'used-pm';
const { name, version } = currentPackageManager();In commonjs:
const currentPackageManager = require('used-pm');
const { name, version } = currentPackageManager();