umma.dev

Yarn, Npm or Npx?

There are a variety of different package managers you can choose from but what makes them different from each other?

Yarn

There are a number of features that come with yarn.

Mutliple Registries

All packages are read and installed from both npmjs.com and Bower.

Select Version Resolutions

You can define packageage versions inside dependencies through resolutions field in package.json file.

Automatic Retries

Network requests are retired when there are temporary network issues.

Parallel Downloads

Reducing build time to run and being efficient with resouces.

Caching

All packages downloaded in a project are cached and do not need to be downloaded multiple times.

Lock File

This file keeps dependencies locked to specific versions.

Npm

Npm enables you to manage packages with local and global dependencies within a project.

All dependencies of a project are kept in a configuration file package.json. In this file you can see the version of the package used within the project.

Another file that also comes with npm is package-lock.json file, this gives the exact version after evaluating the semantic versioning in package.json.

Npx

A tool that is used to execute node.js packages. Sometimes referred to as a utility to run the right application when called from within a project.