Install / Uninstall package(s) programmatically. Detect package managers automatically (npm
, yarn
and pnpm
).
Skips already installed packages. Powered by @antfu/ni
npm i @whoj/manage-pkg
import { installPackage } from '@whoj/manage-pkg';
await installPackage('unplugin', { dev: true });
import { uninstallPackage } from '@whoj/manage-pkg';
await uninstallPackage('unplugin', { silent: true });
import { checkPackageStatus } from '@whoj/manage-pkg';
// This will return false OR package's installed version number
await checkPackageStatus('unplugin');