In this video we are going to see How to install Node.js 16.20 on Windows 10 from Zip archive file and run some sample programs.
You can download Node.js from
https://nodejs.org/en
https://nodejs.org/download/release/v...
Node JS program that prints the Operating System details and Machine Information.
IMPORTANT NOTE on SOURCE CODE: only source code that are acceptable by the youtube description box will be displayed.
#########################SOURCE CODE STARTS HERE##############################
var os = require('os');
console.log("Platform: " + os.platform());
console.log("Architecture: " + os.arch());
console.log("OS Type: " +os.type());
console.log("CPU Cores: ");
console.log(os.cpus());
console.log("Free Memory: " +os.freemem());
console.log("Uptime: " +os.uptime());
console.log("UserInfo: ");
console.log(os.userInfo());
console.log("Platform: " +os.platform());
console.log("OS Release version: " +os.release());
console.log("Total Memory: " +os.totalmem());
console.log("Network Interfaces: ");
console.log(os.networkInterfaces());
console.log("Endianness: " +os.endianness());
console.log("Load Average: " +os.loadavg());
console.log("Temp Directory: " +os.tmpdir());
#########################END OF SOURCE CODE##############################
Node JS program that sorts the array of numbers and print in ascending order and descending order.
#########################SOURCE CODE STARTS HERE##############################
const arr = [35,13,8,25,2,15,887,23,58,23,57,22,67];
arr.sort(function(a, b){return a-b});
console.log("Sorted array in Ascending Order");
console.log(arr);
console.log("Sorted array in Descending Order");
arr.sort(function(a, b){return b-a});
console.log(arr);
#########################END OF SOURCE CODE##############################
#nodejs #nodejstutorial #nodejs16 #nodejswindows #installnodejs