0.1.4 • Published 2 years ago
lopkg v0.1.4
lopkg
local package installer.
lopkg is a solution to a problem with different package managers existing throughout systems. corepack is one solution but it's a systemwide solution and has hardly worked properly for me, so this is a simpler version of corepack.
lopkg installs the requested package manager to be installed into the project folder. You can then use this aliased version in the project as needed.
Usage
- add the following lines to your
package.json
{
"scripts": {
"boot": "npx lopkg", //=> install the latest pnpm by default
"pm": "node pm.cjs"
}
}- Add the following to your
.gitignore
/pm.cjs
/pmx.cjs- Now run the
bootscript to create thepm.cjsandpmx.cjs(not created for all package managers) files.
$ npm run boot- You are all done, you just use
npm run pminstead ofyarnorpnpm, or you could even useyarn pmorpnpm pmif that's shorter and more tied to your muscle memory since the executed package manager is always going to be the one that's in the repository.
CLI Reference
Description
Install a project specific package manager
Usage
$ lopkg [pkgman] [version] [options]
Options
-v, --version Displays current version
-h, --help Displays this message
Examples
$ lopkg yarn
$ lopkg pnpm
$ lopkg pnpm 8.6.2