Short Answer: Javascript on the server side
Long Answer: Node.js is a platform built on Chrome’s JavaScript runtime. It’s used to build fast, scalable network applications. It uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, making it perfect for building real-time applications
var fs = require("fs");
fs.readFile('input.txt', function (err, data) {
if (err){
console.log(err.stack);
return;
}
console.log(data.toString());
});
console.log("Program Ended");
node -v
: check node.js version
node
: Interact with Node Console
node filename
: Run a file with node
npm -v
: check npm version
npm init
: create a package.json
file (manifest file)
To install a package:
// Add -g: to install globally
// --save: to save info in package.json file
npm install express --save
Installed package can be found in node_modules folder
Then, include the package in a Javascript file
var express = require("express");