npm – a quick walk

Aa a part of learning angular, I would suggest everyone to learn and understand basic concept of npm

May be by finding answers for few of questions listed below

  • What is npm?
  • What is the role of npm?
  • How to use it?
  • Why we are going to use it?

So, what is npm?

npm – node package manager

Let’s split the sentence and understand the meaning present in the abbreviation.


Here node.js is mentioned as node. Node.js is a server-side JavaScript environment. It uses an asynchronous event-driven model and is designed for writing scalable internet applications, notably web servers.


Modules of code grouped up into a component which can be used in various project or application.


Managing the dependencies with various operation like install, uninstall, update and so on.

Now, we can frame our own definition for npm from above split up explanation. So using npm, we can manage (install, uninstall, organize) the node.js packages in our project.

npm is a package manager for the JavaScript programming language. It is the default package manager for the JavaScript runtime environment Node.js.

npm has CLI terminal and website to search for packages.

What is the role of npm?

npm does N number of roles in various projects. I’m just mentioning the various which we are going to use in our upcoming posts in the end user developer point of view

  • install packages
  • uninstall packages
  • version maintenance of packages across team
  • maintaining the dependencies

How to use it?

Simple, install Node.js

npm is distributed with Node.js- which means that when we download and install Node.js, we automatically get npm installed on our computer.

Using following command in terminal, we can check whether our tool set get installed successfully,

// to check node.js version
node -v

// to check npm version
npm -v



What is this packages.json? this is the one important thing we should get familiar of we are going for npm.

  • packages.json file is like registry of packages in our project.
  • it lists the packages that our project depends on.
  • allows us to specify the versions of a package that our project can use using semantic versioning rules.

How to create packages.json file?

Open terminal with your target folder location.

Type npm init and Enter, now you’ll be caught up with few questions. After you have answered most of the question, your file will get created.

name and version fields are mandatory fields.


If you are afraid of questions, we have another quick options.

Enter command npm init –yes


Using –yes argument option, the npm will create packages.json file with default values.

Install a package

npm install (in package directory, no arguments) – Install the dependencies in the local node_modules folder.

In global mode (ie, with -g or --global appended to the command), it installs the current package context (ie, the current working directory) as a global package.

You can find detailed details of npm install options in this link

A package can be downloaded with the command:

npm install <package_name>

The --save and --save-dev install flags

The easier (and more awesome) way to add dependencies to your package.json is to do so from the command line, flagging the npm install command with either --save or --save-dev, depending on how you’d like to use that dependency.

To add an entry to your package.json‘s dependencies:

npm install <package_name> --save

To add an entry to your package.json‘s devDependencies:

npm install <package_name> --save-dev


That’s it. Few lines has been copied from official documentation. :p

Lets conclude, using npm we can mange number of packages in our projects easily.

Happy Coding!


Few quick steps to learn core parts of angular 2+

Actually, there is no quick steps to learn any tools or technology unless we are interested or committed to goal of our learning curve.

I just added this title as a temporary one, nothing came up in my mind suddenly. so simply added.

I’m just going list down the various steps/core parts that should be covered in the learning curve of angular 2+

And the steps are,

Step 1
Learn how to install Node.js & npm, whats the purpose of it, and how to use it

Step 2
What is TypeScript? – classes, interfaces, objects

Step 3
Angular CLI – Understanding project structure/architecture, entry point of application

Step 4
Bootstraping, ngmodules, Angular dependency injection

Step 5
Data binding, Observables & Promises, Pipes, and event handling in application

Step 6
Navigation & Routing,

Step 7
Testing – Karma, Jasmine

Step 8
How to deploy your apps in server


I think these are some core parts that needs to learned for building a basic angular application. If you think something could be add up in this, please mention those in comment section.

I’m planning to write each steps in detail in upcoming posts. And the question arrives in my mind or probably some people mind in my network,

  • So this is another how to angular posts?
  • So same story, different post?
  • Before you complete these post, the next version will get release
  • Are people going to read these?

And the answer I tell to myself,

I write to practice my skills, experiment my knowledge, and so on. It makes me happy. So, lets do this.

Happy blogging!


P.S. I shall add posts on each steps mentioned above and link those topics to this posts.