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 CodeNode 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.
Is Node JS
is related to Event driven architecture
?
- Yes Node-JS operates on event driven architecture means it can handle asynchronous operation.
What is Async I/O ?
Node-JS
can handleasynchronous
operation.Async I/0
also known asNon-Blocking I/O
In other words it can perform
input/output
taskswithout blocking
other operations.
History of Node -JS
?
Node-JS
was developed nyRyan Dahl
in 2009.Node-JS
runs Java script code and to run Java script code we need aJava 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 aJava Script-Engine
.Initially
Ryan Dahl
worked withSpider 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
developedNode-JS
independently but a company namedJoyent
shown interested inNode-JS
.
Node-JS
vs Apache HTTP
Server ?
Initially
Apache
was used to createHTTP
server and it's ablocking
server andRyan Dahl
wanted to build a non-blocking server.In other words before
Node -JS
, theApache
HTTP
Server was widely used but hadblocking I/O
, meaning it could handle fewer concurrent requests.Th primary advantage of
Non-Blocking
is it can handle multiple requests with lesser number ofthreads
.
What is NPM
?
NPM
is a package manager forNode-JS
it came in2010
.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 byJoyent
in 2010 initially available forMac-OS
andLinux
.In
2011
Windows
support came up and it was led byJoyent
andMicrosoft
, then windows support forNode-JS
was build.In
2012
,Ryan Dahl
stepped down from managingNode.JS
, andIsaac Z. Schlueter
, creatorNPM
, took over.
How Node-JS
was forked and merged ?
In
2014
, a developer namedFedor Indutny
forkedNode.JS
, creatingIO.JS
, due to disagreements within the community.IO.JS
andNode-JS
merged back together in2015
and they maintainedNode-JS
.In
2019
two major communities, theJS-Foundation
andNode-JS
foundationmerged
to form theOpen-JS Foundation
.