Nodejs ARTICLE

History of Nodejs

Nodejs image
Ryan Dahl

The open source project Node. js was invented by Joyent software engineer Ryan Dahl three years ago next month. It essentially allows JavaScript to be used outside of a browser.Node leverages Google's V8 JavaScript virtual machine to interpret JavaScript, and it uses an event-driven non-blocking I/O model that cloud services vendor Joyent -- a principal Node advocate -- says makes it ideal for data-intensive and real-time applications running across distributed devices. It is also championed by companies such as Microsoft and Mozilla.

Nodejs Introduction

What is Nodejs?

Example

        
          Node.js = Runtime Environment + JavaScript Library
        
      

Features of Node.js

Nodejs Example

        
          var http = require('http');

          http.createServer(function (req, res) {
          res.writeHead(200, {'Content-Type': 'text/plain'});
          res.end('Hello World!');
          }).listen(8080);
        
      
        
           Hello World!
        
      

Object Literal

        
          var obj = {
          authorName: 'Ryan Dahl',
          language: 'Node.js'
          }
        
      

Functions

Example

        
          function Display(x) {
          console.log(x);
          }

          Display (100);