Detect which package manager is used in the current project
npm install which-package-managerDetects the current package manager. Rules applied in order:
- Lock file existence.
- package.json structure compatibility.
- packageManager field.
- First compatible passed preferred package manager.
``sh`
npm install which-package-manager
`js
import { whichPackageManager } from 'which-package-manager';
const packageManager = await whichPackageManager();
``
MIT