NodeJS

Posted on March 9, 2012

0


NodeJS is a platform built on Chrome Javascript runtime. The platform is designed for building fast, scalable, data-intensive network applications. The NodeJS website is available at: http://nodejs.org/.

The NodeJS server module is written in Javascript and implements the new HTML5 Websocket API.  NodeJS is useful for pushing data from a server unto a client.  The Websocket API adds the new functionality of bi-directional or full duplex communication to the web.

In this implementation NodeJS receives a message from FrontlineSMS (through the keyword function), process the message and sends a reply to FrontlineSMS.

For more information on FrontlineSMS keyword function, a comprehensive setup guide is available online at: http://help.frontlinesms.com/manuals/1.5.8/keywords.htm.

To find out more about NodeJS a comprehensive beginners tutorial is available online at: http://www.nodebeginner.org/. Also see NodeJS Manual and Documentation: http://nodejs.org/docs/v0.4.1/api/modules.html.

INSTALLING NODEJS

To install NodeJS, the plugin for the operating system being used must be downloaded, and can be obtained from the project website: http://nodejs.org/.

Screenshot of download options from NodeJS website:

Screenshot installing NodeJS:

Screenshot completing install of NodeJS:

Once the package has been installed, Nodejs can be accessed through the terminal by typing the command – node:

$ node
>
To exit the application, hit CTRL + C twice:
(^C again to quit)
$
To check the version of Nodejs installed, enter the command:
$ node –version
v0.6.11
$

16-04-2012

UPDATED – For developers it might be better to install nodejs through npm as the executable method of install above does not install all the dependencies of node (see post Nodejs OpenFrameworks).

Also see post on socket.io: https://agnetpro.wordpress.com/2012/03/09/socket-io/ and post on websockets: https://agnetpro.wordpress.com/2012/02/21/websocket/.

Nodejs documentation and manual – http://nodejs.org/api/  [accessed 04-04-2012]

Nodejs community – http://nodejs.org/community/

Nodejs and socket io fun project updating a widget – till’s blog   – http://till.klampaeckel.de/blog/archives/133-node.js-socket.io-fun.html  [accessed 15-04-2012]

(Google search nodejs trigger function – http://www.google.co.uk/search?hl=en&site=&source=hp&q=nodejs+trigger+function&oq=nodejs+trigger+function&aq=f&aqi=&aql=&gs_l=hp.3…1207l13096l0l13486l23l21l0l0l0l0l204l1819l15j3j1l19l0.frgbld.)

Mixu’s Node Book – http://book.mixu.net/ [accessed 16-04-2012]

(Google search – escaping special characters nodejs – http://www.google.co.uk/search?hl=en&site=&source=hp&q=escaping+special+characters+nodejs&oq=escaping+special+characters+nodejs&aq=f&aqi=&aql=&gs_l=hp.3…3305l20746l0l21523l36l36l1l16l16l0l127l1766l13j6l19l0.frgbld.)

Nodejs url routing tutorial – http://eigenein.wordpress.com/2011/08/10/let’s-write-url-shortener-with-node-js-routing/  [accessed 16-04-2012]

Up and Running with nodejs book preview by author – http://ofps.oreilly.com/titles/9781449398583/chapter_6.html [accessed 16-04-2012]

Six must have nodejs modules by Nodejitsu – http://blog.nodejitsu.com/6-must-have-nodejs-modules [accessed 15-04-2012]

Nodejs simple push server notification – http://www.gianlucaguarini.com/blog/?p=272

(Google search reading xml data nodejs – http://www.google.co.uk/search?q=reading+xml+data+nodejs&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#q=reading+xml+data+nodejs&hl=en&client=firefox-a&hs=HAt&rls=org.mozilla:en-US:official&prmd=imvns&ei=yEKLT4i1E-jQ0QX7h8jNCQ&start=10&sa=N&bav=on.2,or.r_gc.r_pw.r_qf.,cf.osb&fp=4856109797883548&biw=1049&bih=729)

Nodejs http server api – http://nodejs.org/docs/v0.7.5/api/http.html#http.Server

Nodejs London meetup – http://lnug.org/

Advertisements