Category Archives: Node.js


July 28, 2016 8:17 am

Understanding Node.js


Understanding Node.js
Note.js is built on Google’s Chrome Javascript Engine and it’s a server side platform. In 2009, it was developed by Ryan Dahl. The latest version is v0.10.36. The definition of Node.js can be summed up as follows:Chrome’s Javascript runtime is what Node.js is built off of. It allows you to build scalable and fast network applications.Node.js uses a non-blocking I/O model which is event-driven. It’s efficient and lightweight which makes it the right choice for real-time applications on distributed devices.

[ Read More ]


April 4, 2016 8:58 pm

Creating a Hangman game with Node.js/Angular.js


Creating a Hangman game with Node.js/Angular.js
Hangman is a popular game in which users have to guess the characters in a word with missing letters. Each time they guess a character that does not exist – a man who is being hanged is slowly drawn on the screen. When they get hanged or they complete the word, a new word is given for them and they start anew.

[ Read More ]


March 15, 2016 9:46 pm

Creating a Simple Plagiarism Checker in Node.js


Creating a Simple Plagiarism Checker in Node.js
We are going to create a module which can be used by any application that needs plagiarism checking. For example, it can be used in a website that posts articles on web development to check if the submitted article has not been copied from another source. The module would return JSON and it can be hooked to different routes and application logic to perform different logic depending on the plagiarism score.

[ Read More ]


August 19, 2015 8:25 pm

How to Create Real-time Chat Application with Node.js Part 4


How to Create Real-time Chat Application with Node.js Part 4
Finishing up the back-end: When a user disconnects from our app, we remove the saved nickname from Redis using the lrem method which we use to remove one occurrence of the value stored in the socket.nickname property. Then, we get all users online again and broadcast them to all connected.

[ Read More ]


August 18, 2015 7:10 pm

How to Create Real-time Chat Application with Node.js Part 3


How to Create Real-time Chat Application with Node.js Part 3
The back-end of the chat First we load the express module and set the port to be equal to process.env.PORT (which will be an environment variable defined by Heroku) or 8080 if we are on localhost. Then we create our Express server which will respond to HTTP requests. We load the html entities module, set Socket.IO to listen to our server and require Redis. Theredis.createClient takes as its first argument the port the database is on and as a second argument – the host it is on.

[ Read More ]


August 17, 2015 7:31 pm

How to Create Real-time Chat Application with Node.js Part 2


How to Create Real-time Chat Application with Node.js Part 2
The client-side JavaScript: First, we initialize our socket client, ask the user for a name and keep asking him until he types less than 26 characters. Then, we check if the form is submitted (there is only one form and it handles new messages) and if the message does not contain more than 100 characters we send the data to the server using the socket.emit(eventName, messageToPass) method.

[ Read More ]


August 16, 2015 7:11 pm

How to Create Real-time Chat Application with Node.js Part 1


How to Create Real-time Chat Application with Node.js Part 1
In the next tutorials, we will be building a simple Node.js chat application. Messages will be delivered in real-time and we are going to take advantage of the Speech Synthesis API for the supporting browsers so that the computer can read aloud the messages as they arrive in the chat. We will be using Node.js, Express and Redis for persistence. Express is a very popular framework for Node.js that eases development and provides many useful features.

[ Read More ]