What is Node.js and NPM
Goal: Understand what Node.js and NPM are and how they work.
1. Node.js
Node.js is a runtime environment for running JavaScript outside the browser.
console.log("Hello from Node.js!");
Run:
node app.js
2. Architecture
Node.js is powered by the V8 engine, uses a single thread, and handles operations asynchronously.
3. Modules
const os = require("os");
console.log("OS:", os.platform());
console.log("Memory:", os.totalmem());
4. NPM — package manager
npm init -y npm install express npm uninstall express
5. Local and global packages
npm install -g nodemon
6. Practice:
Create a Node project, install chalk, and print colored text to the console.