Npm Npx & Yarn

Npm Npx & Yarn

Introduction about package managers for React Native

Packages

A package is a collection of files that are bundled together( some information, docs and config files) which can be installed and removed as a group.

A package is just a particular program mostly or a part of a program.

Package Manager

A package manager keeps track of what packages are installed, and allows you to easily install new packages, upgrade packages to newer versions, or remove packages previously installed.

What is NPM

NPM – or "Node Package Manager" – is the default package manager for JavaScript's runtime Node.js and comes with the node installation.

NPM consists of two main parts:

a CLI (command-line interface) tool that interacts with a remote registry, It allows users to consume and distribute JavaScript modules that are available in the registry. an online repository that hosts JavaScript packages (Registry) Each npm package/module is a directory with more than one files along with a package.json file which has the metadata name, version, dependency etc. of the package.

What is NPX

The npx stands for Node Package Execute and it comes with the npm.

It is an npm package runner that can execute any package that you want from the npm registry without even installing that package.

What is YARN

YARN is another Package Manager and is an optimized management tool.

registry packages can be handled using YARN setup.

It also facilitates offline package install.

Advantages

The key advantage of YARN setups is its optimized ability to handle package downloads in an extremely quick pace and also its ability to work on offline mode.

Fast: All downloaded packages will be captured by YARN, which nicely avoids the download of these packages multiple times. Resource utilization is another great advantage of YARN which is easily achieved to concurrent execution of systems an packages and this process largely increases the speed of execution.

Reliable: Using a thorough but short format in the lock file and an algorithm which deterministically operates each and every installation it faces, another extraordinary advantage of YARN is like it finely guarantees that all installation work with same pace and speed across any of the systems it operates.

Secure: Checksums are issued at frequent intervals to check the integrity of all the packages which are installed and this takes place before executing its code setup.