JavaScript
Getting Started with Node.js and NPM
JavaScript used to be confined to the browser. Then Node.js came along and allowed us to run JavaScript on the server. For a beginner, installing Node also installs NPM (Node Package Manager). NPM is the world's largest software registry. You’ll use it to install libraries for your projects. To start a new project, you run npm init in your folder, which creates a package.json file. This file tracks your project dependencies. To install a library, like Express for a web server, you run npm install express. This creates a node_modules folder (which you should never commit to git—add it to your .gitignore!). The magic of Node is that it allows you to write backend logic in the same language as your frontend. I started with a simple 'Hello World' HTTP server, and it was surreal seeing JavaScript respond to HTTP requests.
Tags
3,763
Views
146
Words
1 min read
Read Time
May 2025
Published