April 30, 2024
Use the right package manager

Are you tired of dealing with multiple package managers in your projects? Dependency management across different platforms, such as npmyarnpnpm, and bun, can often create headaches and confusion.

But luckily, there’s a tool that can help: niNi is a command-line utility that allows you to manage packages across different package managers seamlessly.

With ni, you no longer need to worry about your dependency management for each project. Simply run ni and let the tool handle it for you. This can be a real time saver and makes your development workflow much smoother.

Here are a few examples of how you can use ni:

  • ni – installs packages using the correct package manager
  • ni vite – installs vite using the correct package manager
  • ni @types/node -D – installs @types/node as a dev dependency using the correct package manager
  • ni –frozen – installs packages using the correct package manager with the –frozen flag
  • ni -g eslint – installs eslint globally using the correct package manager

ni is not just limited to package management – there are other useful commands available as well, such as:

  • nr – runs scripts using the correct package manager
  • nlx – download & execute packages using the correct package manager
  • nu – upgrades packages using the correct package manager
  • nun – uninstalls packages using the correct package manager

To use ni, simply install it with npm i -g @antfu/ni. For more information and examples, check out the official documentation.

With ni, you can stop worrying about which package manager to use and get back to what you do best – writing code!

Want to read more? Check out this one: npm-vs-yarn-vs-pnpm

Leave a Reply

Your email address will not be published. Required fields are marked *