An Interest In:
Web News this Week
- April 18, 2024
- April 17, 2024
- April 16, 2024
- April 15, 2024
- April 14, 2024
- April 13, 2024
- April 12, 2024
Switch Package Manager
Well, I'm working on projects that use different Package Managers and I'm a little sick of writing wrong commands or mixing the incorrect flags.
I've started creating a command cheatsheet to guide me through, but if speak with truth, it was not enough, because don't solve the problem at all.
npm vs yarn vs pnpm commands cheatsheet
Camilo Martinez May 10 2 min read
So, inspired by projects like NVM
and Volta
I've decided to create a CLI translator, to write command in only one form and this CLI tool will translate it to the current package manager form used in the project.
That's how swpm (Switch Package Manager) was born.
deinsoftware / swpm
Switch Package Manager
Switch Package Manager
Menu
Getting Started
When switching between JavaScript projects, it's often easy to forget which package manager should be used. JavaScript package managers aren't quite compatible either and each one resolves dependencies differently, so accidentally installing with npm
could cause a yarn
or pnpm
project to break.
swpm
is a CLI that intends to solve this problem by unifying the most used commands for the most common Node Package Managers into one. It will recognize the Package Manager used on the project and automatically will translate those commands.
This is an example of how #swpm works. The same command, no matter the package manager used on the project.
Note:
We will start with most used command, then other commands will be added gradually.
Track the command progress implementation on CHEATSHEET
Prerequisites
What things you need to install?
Installing
npm install
This is an example of how #swpm works. The same command, no matter the package manager used on the project.
This is a WIP project, and for now, there are only available the most used commands install
, add
, and remove
, but we add other gradually (or by request).
So if you are in the same boat as me, or don't want to relearn commands for each package manager, install swpm
...
npm install --global swpmyarn global add swpmpnpm install -global swpm
... and enjoy life.
Comments and contributions are welcome. I'm not an expert in node.js
so I'm sure not following the best practices, but we are here to learn.
I hope this project does not finish as the XKCD story about standards.
Thats All Folks!
Happy Coding
Original Link: https://dev.to/equiman/switch-package-manager-287m
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To