Angular Architecture Back End Cloud Infrastructure Services Students Support Tools Web

(36) What is Node.js?

What is Node.js?

Node.js.  Node.js is an open-source, cross-platform JavaScript run-time environment that executes JavaScript code outside of a browser.  JavaScript is, of course, typically run in a browser to work with HTML documents.

Node.js frees JavaScript up from those browser constraints and can thus be used for command line applications, server-side coding, and anywhere else that general purpose programming languages might be used.

Node.js has an event-driven architecture and asynchronous I/O.  Those design choices optimize throughput and scalability and make the capabilities of the language similar to those of C# or Java.

Node.js Web Servers.  Node.js allows the creation of Web servers and networking tools using JavaScript and a collection of “modules” that handle various core functionality.  Modules are provided for file system I/O, networking (DNS, HTTP, TCP, TLS/SSL, or UDP), binary data (buffers), cryptography functions, data streams, and other core functions.  Node.js’s modules use an API designed to reduce the complexity of writing server applications.

Though initially the module system was based on common.js module pattern, the recent introduction of modules in the ECMAScript specification has shifted the direction of using ECMAScript Modules in Node.js by default instead.

Node.js is primarily used to build network programs such as Web servers.  The biggest difference between Node.js and PHP is that most functions in PHP block until completion (commands execute only after previous commands finish), while Node.js functions are non-blocking (commands execute concurrently or even in parallel, and use callbacks to signal completion or failure).

Platform Architecture.  Node.js brings event-driven programming to web servers, enabling development of fast web servers in JavaScript. Developers can create highly scalable servers without using threading, by using a simplified model of event-driven programming that uses callbacks to signal the completion of a task. Node.js connects the ease of a scripting language (JavaScript) with the power of Unix network programming.

Node.js was built on the Google V8 JavaScript engine.  It is extremely fast and proficient with internet fundamentals such as HTTP, DNS, and TCP.  Also, JavaScript was a well-known language, making Node.js immediately accessible to the entire web development community.

Industry Support.  There are thousands of open-source libraries for Node.js, most of them hosted on the npm website. There are multiple developer conferences and events that support the Node.js community including NodeConf, Node Interactive and Node Summit as well as a number of regional events.

Modern desktop IDEs provide editing and debugging features specifically for Node.js applications. 

Leave a Reply

Your email address will not be published. Required fields are marked *