Tuesday, 27 September 2016

Learning Node.js

Node.js has always looked interesting to me, yet I have never explored it properly.

Every time I hear people mention Node.js its almost always followed by the words "web-server", so naturally I assumed Node.jswas a light weight web-server. Turns out (by just Googling node.js) that it is in fact just a JavaScript Run-time.

Once I installed Node I realised I could just run the following in a console:

$ node> console.log('Hello');HelloundefinedUndefined is returned because node returns the return value of each command. This command has no return value.

Now running $ node web-server.js will launch the web-server, going to http://localhost:8080 will show the text.Node.js has a very large number of library's which can be used to do almost anything. One project I am quite keen on is a drag and drop page which will parse a CSV file and output relevant data. I'm going to be working on this over the next few hours and I will update this post once complete.