What is the advantage of the Node.js frameworks?
What is the exit code in Node.js
How many types of API functions are there in Node.js?
error-first callback in Node.js
What is the Reactor Pattern in Node.js?
What are the main differences between spawn() and fork() methods in Node.js?
What is the purpose of ExpressJS package in Node.js?
Explain the security mechanism of Node.js?
What is NodeJS
Node.js is an open-source server side runtime environment built on Chrome's V8 JavaScript engine. It provides an event driven, non-blocking (asynchronous) I/O and cross-platform runtime environment for building highly scalable server-side application using JavaScript.
Node.js can be used to build different types of applications such as command line application, web application, real-time chat application, REST API server etc. However, it is mainly used to build network programs like web servers, similar to PHP, Java, or ASP.NET.
Node.js was written and introduced by Ryan Dahl in 2009. Visit Wikipedia to know the history of Node.js.
Advantages of Node.js
1.Node.js is an open-source framework under MIT license. (MIT license is a free software license originating at the Massachusetts Institute of Technology (MIT).)
2.Uses JavaScript to build entire server side application.
3.Lightweight framework that includes bare minimum modules. Other modules can be included as per the need of an application.
4.Asynchronous by default. So it performs faster than other frameworks.
5.Cross-platform framework that runs on Windows, MAC or Linux
Node.js Basics
Node.js supports JavaScript. So, JavaScript syntax on Node.js is similar to the browser's JavaScript syntax.
Primitive Types
Node.js includes following primitive types:
>String
>Boolean
>Undefined
>Null
>RegExp
>Everything else is an object in Node.js.
Loose Typing
JavaScript in Node.js supports loose typing like the browser's JavaScript. Use var keyword to declare a variable of any type.
Object Literal
Object literal syntax is same as browser's JavaScript.