Node.
js is a powerful, open-source, and cross-platform (what
is mean by cross-platform, What is operating system , there
are hundreds of os present in the market , )JavaScript
runtime environment built on Chrome's V8 engine(v8 engine
is inspried by car engine).(In 2009 Ryan began developing
node js (originally he named it as web js)then he start
experimenting Firefox's Spider Monkey JavaScript engine
that but do to some limitations. he just switch to v8 in 2 day)
-Over 41% of professional developers use [Link]
-Netflix have reduced startup time by 70% after adopting
[Link].
-companies use node js(LinkedIn, PayPal, NASA)
-Node js is not a language
-node js is not a library
-node js is not a framework
-node js is a run-time environment.
node js environment
js source code ----> v8 engine ---> machine code
-node js is non-blocking (what is mean by non-blocking )
our first concept REPL
READ EVAL PRINT LOOP
command line > node -v, npm -v.
node ,2+3 , a= "apple" , function cal(a,b){return a+b }
open vs code > [Link]("welocome to [Link]")
to run "node [Link]"
Built in modules
There are lot of build modules in [Link], in that most used
modules
os,path,file,http
const os = require('os')
[Link]([Link]());
[Link]([Link]());
[Link]([Link]());
[Link]([Link]());
const path = require('path')
[Link]([Link](__filename))
[Link]([Link](__filename))
[Link]([Link](__filename))
[Link]([Link](__filename))
HTTP
const http = require('http ')
const myServer = [Link]((request, response) => {
[Link]("welcome to server")
[Link]()
})
[Link](3330)