It finds all package-managers installed in the system. It finds them without requiring any external dependency.
Well, sometimes you might want to install dependencies dynamically based on the package-managers. Some folks prefer yarn over npm.
- npm
- yarn
- installation:
npm install --save findall-pkg-mgr
- Use as a module
const findPkgMngr = require('findall-pkg-mgr');
// Find all available package managers
const pkg_mgrs = findPkgMngr.findAll();
console.log(pkg_mgrs); // [ 'npm', 'yarn' ]
// Check if a specific package manager is available
const isNpmAvailable = findPkgMngr.isAvailable('npm');
console.log(isNpmAvailable); // true
const isYarnAvailable = findPkgMngr.isAvailable('yarn');
console.log(isYarnAvailable); // false