In this series of articles, we aimed to cover the following topics:
- Important ES6 Features
- Objects and Array methods
Let’s first start with NPM:
What is NPM?
NPM has three components:
- The website (Using the website we can find, share, and view packages)
- The Command Line Interface (CLI) (The CLI is the component that helps us in managing our packages)
- The registry (The npm registry is the database where all the packages exist, we can download packages published by other developers and can also publish our own packages to the registry)
- NPM can also be used to publish and manage private packages.
- A package is simply a program that performs one or more operations.
NPM comes pre-installed with node.js. So, you don’t need to worry about installing it manually, you just have to install node.js on your system.
To install node.js, visit https://nodejs.org/en/download, and install its LTS (Long Term Support) version.
After installation, use the commands shown below to check if they are installed:
// to check nodejs's version node -v or node --version // to check npm's version npm -v or npm --version
The package.json file is like the manifest of your project. It makes it easier to install and manage packages. It consists of all the metadata of the project that will be useful while sharing the project with other developers.
According to the official docs:
A package.json file:
- lists the packages your project depends on
- specifies versions of a package that your project can use using semantic versioning rules
- makes your build reproducible, and therefore easier to share with other developers