Introduction to Node-JS

Introduction to Node-JS

What is Node-JS ?

  • Node JS is a JavaScript runtime built on Chrome's V8 JavaScript engine.

  • In other words Node -JS is built on top of "Chrome V8 Java Script Engine" which is known for high performance and efficient execution of JS Code

  • Node JS is cross platform means it can run on windows,linux and also on other platforms.

  • Node JS is Open source and it is maintained by Open JS Foundation.

  • Node JS executes Java Script outside the web browser.

  • Yes Node-JS operates on event driven architecture means it can handle asynchronous operation.

What is Async I/O ?

  • Node-JS can handle asynchronous operation. Async I/0 also known as Non-Blocking I/O

  • In other words it can perform input/output tasks without blocking other operations.

History of Node -JS ?

  • Node-JS was developed ny Ryan Dahl in 2009.

  • Node-JS runs Java script code and to run Java script code we need a Java script-Engine whether it's in a browser like Chrome or a server Environment or in other words wherever there is Java Script there is a Java Script-Engine.

  • Initially Ryan Dahl worked with Spider Monkey which itself is a Java script Engine but switched in 2 days to the V8 Engine to Google Chrome due to it's performance. Now V8 engine powers Node-JS.

  • Ryan Dahl developed Node-JS independently but a company named Joyent shown interested in Node-JS.

Node-JS vs Apache HTTP Server ?

  • Initially Apache was used to create HTTP server and it's a blocking server and Ryan Dahl wanted to build a non-blocking server.

  • In other words before Node -JS, the Apache HTTP Server was widely used but had blocking I/O, meaning it could handle fewer concurrent requests.

  • Th primary advantage of Non-Blocking is it can handle multiple requests with lesser number of threads.

What is NPM ?

  • NPM is a package manager for Node-JS it came in 2010.

  • NPM is basically a resistor or a central place where we can add new packages and packages can be of anything example if we want to handle time, date, images etc. there are separate packages for it.

  • NPM was developed by Joyent in 2010 initially available for Mac-OS and Linux.

  • In 2011 Windows support came up and it was led by Joyent and Microsoft, then windows support for Node-JS was build.

  • In 2012, Ryan Dahl stepped down from managing Node.JS, and Isaac Z. Schlueter, creator NPM, took over.

How Node-JS was forked and merged ?

  • In 2014, a developer named Fedor Indutny forked Node.JS, creating IO.JS, due to disagreements within the community.

  • IO.JS and Node-JS merged back together in 2015 and they maintained Node-JS.

  • In 2019 two major communities, the JS-Foundation and Node-JS foundation merged to form the Open-JS Foundation.

In 2024 Node-JS continues to be widely used.