Node.js Basics

Node let’s you run JavaScript programs outside of the browser. For example, you can run javascript code on the command line. If you are a good javascript programmer, you are no longer limited to the confines of the browser.

Node.js is non-blocking (can run multiple tasks, and keeps processing tasks while waiting for response) and is less heavy on system resources like memory and processing speed.

REPL

Just typing node at the command line and it will open a read-evaluate-print-loop (interactive REPL), like Python. To exit, press ctrl+c twice.

Hello World

Create a file called app.js

console.log('Bonjour la monde!');

Run the file from the command line

node app.js

Project: Parse JSON data using Node.js

We’ll

connect to the API URL

read the data

parse the data

print the data

Please note that this site and the posts on it are, and will always be, a work in progress. If i waited for perfection, i’d never get anything done.
A project of 29 CONCEPTS SMC-PVT LTD. Created with by Aamnah. All content is licensed under Creative Commons CC BY-SA 4.0