Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
May 23, 2022 07:02 pm GMT

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.

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.

GitHub logo deinsoftware / swpm

Switch Package Manager

Switch Package Manager

buildpublishnpm-versionnpm-downloadsjs-standard-stylenode-enginevoltalicense

swpm

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.

swpm-example

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.

example

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.

Image description

Thats All Folks!
Happy Coding

Buy me a cofee


Original Link: https://dev.to/equiman/switch-package-manager-287m

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To