Node.js is an asynchronous event driven JavaScript runtime built on Chrome's V8 JavaScript engine. It is deisnged to build scalable networking applications but can also be used to develop applications with GUI's using thrid party libraries. The Node Package Manager (npm) allows you to install third party packages either from the npm repository or install a local package from your computer.
Getting Started
Node.js is extremly simple to install on all OS platforms. On Windows there is an installer, which guides you through the setup process. For Ubuntu users simply type the following command.
sudo apt-get install nodejs
Once the process has completed, you can verify, if Node.js is installed correctly by typing the following command.
nodejs --version
Node Packager Manager (npm) is installed by default when you install Node.js. You can verify if npm is installed by typing the following command.
npm --version
Now that Node.js is installed, you can write your first program. Open a text editor and write the famous Hello World program. Save the file as app.js.
Listing 1
console.log("Hello World");
To execute the code, cd into the directory where app.js is located in a terminal or command prompt and type the following command.
nodejs app.js
You should now see Hello World printed to the terminal. This example doesnt demonstrate a lot but in the next few articles you'll become to relaise just how powerful Node.js is.
-
A JavaScript Implementation Of The Logo Programming Language - Part 2
Part 2 of A Javascript Implementation Of The Logo Programming Language. In the previous article I explained how to develop a simple lexer. In this part we develop a TokenCollection class to help traverse the array of tokens returned from the lexer.
10 June 2020 - 2499 views -
A JavaScript Implementation Of The Logo Programming Language - Part 1
In this four part article, I explain how to develop the iconic Logo programming language in JavaScript. In this part, we discuss how to take a source input and convert it into a series of tokens.
06 June 2020 - 4672 views -
Generating Web API Keys
If you're building a REST API, chances are you're going to need to generate secure random API keys. In this article, I explain how to use the Node.js crypto module to generate random secure API keys.
29 May 2020 - 7241 views -
Port Scanner
A simple port scanner to scan a range of ports.
31 January 2020 - 3150 views -
Sorting Algorithms
An introduction to sorting algorithms.
29 November 2019 - 2125 views -
Simple Http Server
This article explains how to create a simple HTTP server using Node.js without using any dependencies.
04 September 2019 - 2029 views -
Reading From Console
Node.Js provides several ways to read user input from the terminal. This article explains how to use the process object to read user input.
16 July 2019 - 2562 views