pkg-man
Detect which package manager that should be used
Installation
npm install --save pkg-man
Usage
$ tree├── bar│ ├── package.json│ └── yarn.lock├── baz│ ├── package-lock.json│ ├── package.json│ └── yarn.lock├── foo│ ├── package-lock.json│ └── package.json└── package.json
const pkgMan = ; ;//=> yarn ;//=> npm ;//=> npm ;//=> npm ;//=> yarn ;//=> yarn
API
pkgMan([options])
options
Type: Object
cwd
Type: string
Default: process.cwd()
Current working directory.
preferred
Type: string
Default: npm
Preferred package manager if no lockfile or multiple lockfiles found.
Related
- pkg-man-cli - CLI for this module
- has-lockfile - Detect lockfiles in the working directory
License
MIT © Lufty Wiranda