Loading ...

📚 Chapters

What is npm?

✍️ By Arun Kumar | 11/14/2025

npm stands for Node Package Manager.

It is a tool that comes with Node.js and is used to:

  1. 1. Install libraries and packages that your project needs.

  2. 2. Manage dependencies for your project.

    • 3. Run scripts (like starting a development server, building your project, or running tests).


      Key Points

          • -Node.js → Lets you run JavaScript outside the browser (on your computer/server).
          • -npm → Lets you download and manage code libraries (like React, Express, Axios, etc.) that make development easier.


    Example Usage

    1. 1. Install a library/package

      npm install axios


        • This downloads the axios package into your project.

        • 2. Run a script from package.json

        • npm run dev

          This runs the development server for your React app.


          1. 3. Initialize a new Node project

          npm init -y
            • Creates a package.json file, which keeps track of your project’s dependencies and scripts.


      Analogy

        Think of Node.js as your “engine” that runs JavaScript on your computer, and npm as a “toolbox” full of libraries and utilities you can use to build your project faster.


        💬 Comments

        logo

        Comments (0)

        No comments yet. Be the first to share your thoughts!