DEV Community

Discussion on: How to migrate from yarn / npm to pnpm

Collapse
 
equiman profile image
Camilo Martinez

I'm in a project transition moving from npm to pnpm and it is a nightmare to remember when using each one.

So I decided to create a command to do this. One command will translate to the respective PM.

npmjs.com/package/swpm

Collapse
 
andreychernykh profile image
Andrei Chernykh

Cool stuff!

Collapse
 
subbumsd profile image
Venkata Subbarao Myla

I found another package which does the same. github.com/antfu/ni

Collapse
 
equiman profile image
Camilo Martinez • Edited

I've tested ni and it is an amazing project too, but have a different approach.

ni focus only on commonly used commands and assign an alias to each one.

The SWPM key differences are:

  • Not limited to some commands or alias, you can use the whole Package Managers.
  • Flags to change his behavior on the fly, like say which Package Manager uses (for example when no lock file exists) or test the command translation.
  • Include a clean command to delete common folders like node_modules.
  • Also, have aliases (like ni) but include another set of commonly used alias like save-dev, exact-version, and others that have been requested by the users.
  • NVM and Volta compatible.
  • Detect lock files, but also work pining manually with the Package Managers (or with the use flag when even no lock file exists).