JavaScript runtime — modules, HTTP, Express, databases and Raspberry Pi — written by Aivasu Tech Institute's mentors. Free to read, structured to actually help you learn.
Node.js notes by Aivasu Tech Institute cover 105 topics — from node home to raspi components — each explained with short definitions, syntax and runnable code examples. They are 100% free, need no signup, and work as quick revision for college exams, Node.js interviews and Aivasu Tech Institute's mentor-led Node.js course in Pitampura, Delhi.
Node.js Tutorial chapters
Asynchronous chapters
Module Basics chapters
Core Modules chapters
JS & TS Features chapters
Building Applications chapters
Database Integration chapters
Advanced Communication chapters
Testing & Debugging chapters
Node.js Deployment chapters
Perfomance & Scaling chapters
Node.js Advanced chapters
Hardware & IoT chapters
No notes found. Try a different search term, or browse all Node.js notes.
Node.js is a free, open source tool that lets you run JavaScript outside the web browser.
- Core concepts like modules and the event loop
2. Download the LTS (Long Term Support) version
If you're new to JavaScript, don't worry!
Node.js and browsers both run JavaScript, but they have different environments and capabilities.
Node.js provides a powerful command line interface (CLI) that allows you to run JavaScript files, manage packages, debug applications, and more.
The V8 engine is Google's open-source JavaScript engine, used by Chrome and Node.js.
Node.js uses a single-threaded, event-driven architecture that is designed to handle many connections at once, efficiently and without blocking the main thread.
The event loop is what makes Node.js non-blocking and efficient.
In Node.js, asynchronous operations let your program do other work while waiting for tasks like file I/O or network requests to complete.
Promises in Node.js provide a cleaner way to handle asynchronous operations compared to traditional callbacks.
Async/await is a modern way to handle asynchronous operations in Node.js, building on top of Promises to create even more readable code.
Errors are inevitable in any program, but how you handle them makes all the difference. In Node.js, proper error handling is crucial because:
Modules are the building blocks of Node.js applications, allowing you to organize code into logical, reusable components. They help in:
ES Modules (ESM) is the official standard format for packaging JavaScript code for reuse.
NPM is a package manager for Node.js packages, or modules if you like.
package.json is a special file that describes your Node.js project.
NPM scripts are commands you define in your package.json file to automate tasks like:
Dependency management is the process of tracking, installing, updating, and removing the external packages your application depends on.
Publishing a package means making your Node.js module or project available for others to install and use via the npm registry.
Node.js includes a powerful built-in HTTP module that enables you to create HTTP servers and make HTTP requests.
The HTTPS module is a core Node.js module that provides an implementation of the HTTPS protocol, which is essentially HTTP over TLS/SSL.
The Node.js File System module (fs) provides a comprehensive set of methods for working with the file system on your computer.
The Path module is a built-in Node.js module that provides tools for handling and transforming file paths across different operating systems.
The OS module in Node.js provides a powerful set of utilities for interacting with the underlying operating system.
The URL module provides utilities for URL resolution and parsing.
Every action on a computer is an event, like when a connection is made or a file is opened.
In Node.js, streams are collections of data, which might not be available in full at once and don't have to fit in memory.
The Buffer module in Node.js is used to handle binary data.
The Crypto module is a built-in Node.js module that provides cryptographic functionality including:
The Timers module provides functions that help schedule code execution at specific times or intervals.
The DNS (Domain Name System) module provides functionality for name resolution in Node.js.
The Assert module provides a simple yet powerful set of assertion tests for validating invariants in your code.
The Util module is a core Node.js module that provides a collection of utility functions for common tasks.
The Readline module is a core Node.js module that provides an interface for reading data from a Readable stream (like process.stdin ) one line at a time.
ES6 (ECMAScript 2015) and later versions add powerful new features to JavaScript that make your code more expressive, concise, and safer.
Process management in Node.js is about controlling your application's lifecycle.
TypeScript is a superset of JavaScript that adds optional static typing.
This guide dives into advanced TypeScript features and patterns specifically useful for Node.js applications.
Consistent code quality and style is important for Node.js projects, especially in team environments.
Node.js frameworks provide structure, organization, and common utilities for building web applications, APIs, and more.
Express.js (or simply Express) is the most popular Node.js web application framework, designed for building web applications and APIs.
Middleware is a key part of Node.js web applications, particularly in Express.js.
REST (Representational State Transfer) is an architectural style for designing networked applications that has become the standard for web services.
API authentication is the process of verifying the identity of clients accessing your Node.js APIs.
Introduction to Frontend Integration with Node.js
Node.js can be used in database applications.
To create a database in MySQL, use the "CREATE DATABASE" statement:
To create a table in MySQL, use the "CREATE TABLE" statement.
To fill a table in MySQL, use the "INSERT INTO" statement.
To select data from a table in MySQL, use the "SELECT" statement.
When selecting records from a table, you can filter the selection by using the "WHERE" statement:
Use the ORDER BY statement to sort the result in ascending or descending order.
You can delete records from an existing table by using the "DELETE FROM" statement:
You can delete an existing table by using the "DROP TABLE" statement:
You can update existing records in a table by using the "UPDATE" statement:
You can limit the number of records returned from the query, by using the "LIMIT" statement:
You can combine rows from two or more tables, based on a related column between them, by using a JOIN statement.
Node.js can be used in database applications.
To create a database in MongoDB, start by creating a MongoClient object, then specify a connection URL with the correct ip address and the name of the database
Note: A collection in MongoDB is the same as a table in MySQL
To insert a record, or document as it is called in MongoDB, into a collection, we use the insertOne() method.
Note: In MongoDB we use the find and findOne methods to find data in a collection. Just like the SELECT statement is used to find data in a table in a MyS
When finding documents in a collection, you can filter the result by using a query object.
Use the sort() method to sort the result in ascending or descending order.
To delete a record, or document as it is called in MongoDB, we use the deleteOne() method.
You can delete a table, or collection as it is called in MongoDB, by using the drop() method.
You can update a record, or document as it is called in MongoDB, by using the updateOne() method.
To limit the result in MongoDB, we use the limit() method.
MongoDB is not a relational database, but you can perform a left outer join by using the $lookup stage.
GraphQL is a query language for APIs and a runtime for executing those queries against your data. It was developed by Facebook in 2012 and publicly released in
Socket.IO is a powerful JavaScript library that enables real-time, bidirectional, and event-based communication between web clients and servers. It's designed t
WebSockets provide a persistent connection between client and server, allowing for real-time, bidirectional communication.
Effective debugging is a critical skill for Node.js developers.
Testing is an essential part of software development that provides numerous benefits:
Introduction to Node.js Testing Frameworks
The built-in node:test module provides a lightweight, no-dependency framework for writing and running JavaScript tests directly in Node.js.
Environment variables are dynamic named values that can affect how running processes behave on a computer.
Differences between Development and Production
Continuous Integration (CI) and Continuous Deployment (CD) are essential practices that automates the software development lifecycle, enabling teams to deliver
Security is critically important for Node.js applications for several reasons:
Deployment strategies focus on how to deploy and manage your Node.js applications in production.
Effective logging is essential for several reasons:
Observability in Node.js applications involves collecting and analyzing metrics and logs to understand system behavior.
Node.js offers various tools and techniques for diagnosing performance issues.
The Child Process module is a built-in Node.js module that allows you to create and manage child processes.
The Cluster module provides a way to create multiple worker processes that share the same server port.
Worker Threads are a feature introduced in Node.js (initially in v10.5.0 as an experimental feature and stabilized in v12) that allows JavaScript code to run in
Microservices is an architectural style that structures an application as a collection of small, loosely coupled services. Each service is:
WebAssembly (Wasm) is a binary instruction format designed as a portable compilation target for high-level languages like C, C++, and Rust.
The Node.js HTTP/2 module provides an implementation of the HTTP/2 protocol, offering improved performance, server push capabilities, header compression, and mu
The perf_hooks module provides a set of APIs for performance measurement based on the W3C Performance Timeline specification.
The VM (Virtual Machine) module allows you to compile and run code within isolated contexts.
Transport Layer Security (TLS) and its predecessor, Secure Socket Layer (SSL), are protocols that provide secure communication over a computer network. They ens
The Net module is one of Node.js's core networking modules, allowing you to create TCP servers and clients. TCP (Transmission Control Protocol) is a reliable, o
The Zlib module provides bindings to the zlib and brotli compression libraries, enabling you to:
One of the most common Node.js applications is building RESTful APIs. Here's an example of a simple but practical Todo API with Express:
Raspberry Pi is a small, multi-use computer.
GPIO stands for General Purpose Input Output.
In this chapter we will use a Raspberry Pi and its GPIO to make a LED blink.
In the previous chapter we learned how to use a Raspberry Pi and its GPIO to make a LED blink.
Using Array With Output to Create Flowing LEDs
WebSocket enables bidirectional communication in real time over the web.
In the previous chapters we have learned how to use WebSocket, and how to use GPIO to turn LEDs on and off.
Components are parts of a larger whole. In this chapter, we explain the different components we use in our tutorial.
Join Aivasu Tech Institute's Node.js course — live mentorship, hands-on projects, and 100% placement support in Delhi NCR.
Enroll Now — Free Demo Available✳ Common questions
What students search before reading Node.js notes.