Leanpub Header

Skip to main content

Topics

Node.js

From the event loop, modules and npm to Express and other frameworks, streams, clustering, security, testing, Deno and running JavaScript outside the browser, Node.js as told through the free samples of the Leanpub books about it.

Created from the free samples of 16 Leanpub books and the descriptions and tables of contents of 20 more, with every source cited.

Node.js is a runtime environment that executes JavaScript outside a web browser. A recent beginner's guide on this shelf is careful about what that means: Node.js is neither a framework nor a programming language but an asynchronous, event-driven environment, made of a JavaScript engine, two module systems, interfaces to the operating system, the file system and the network, and an event loop, which together let the language be used for servers, command-line tools and scripts.[1] An older book states the consequence that made it popular: a web developer who had needed one language for the browser, another for the server and a third for the database could now work in a single language across every layer.[3]

The runtime does its work in one thread, which is its characteristic strength and its characteristic trap. A short book on one of its modules points out that a program started in the ordinary way uses a single processor core and leaves the rest of the machine idle,[23] and a recent one calls the blocking of the event loop the silent killer of performance in production.[21] Round the small core has grown the largest collection of packages of any language, a succession of web frameworks and, more recently, rival runtimes, one of which has a book here.[25]

This article covers where to begin, the history, the runtime and its internals, building web servers, frameworks, full-stack JavaScript, tooling and automation, security and testing, and hardware and industrial uses. Its sources are the free samples of the Leanpub books listed at the end, with the descriptions and tables of contents of the books whose samples were not available, and every claim that rests on a source is cited to it.

Where to start

The classic first book is The Node Beginner Book (2018), the best seller on the shelf, a short tutorial that builds one small web application and teaches the necessary JavaScript on the way.[19] The Beginners Guide To Node.js (2016) is shorter still and assumes no programming at all: it explains why Node.js was created, the event loop, the package manager and installation, and says plainly that it does not teach JavaScript or anything advanced, such as streams, servers or testing; a series of videos accompanies it.[9] Node.js and Express.js Simplified is a current beginner's guide from the runtime's fundamentals to a web framework,[1] Awesome Coding (2023) teaches JavaScript and then Node.js through projects,[20] and Code to Career: JavaScript & Node.js from Zero to Professional is a long course from no experience to back-end applications. Its foreword explains the motive: the author's first program produced an error message, and it was five years before anyone taught the reading of one; learners today have hundreds of resources, none connected to the others, and the book means to tell the whole road in one voice and one order, with the history of each topic, because knowing why a thing exists helps in learning it.[13]

A programmer who can already write basic applications should go on to The Node Craftsman Book (2017), the sequel to the first book named above, which covers the package manager, test-driven development, databases and an application built in two parts.[2] From there the choice is by subject: Node.js Event Loop (2025) and Understanding Node.js stream module by implementing it from scratch (2021) for the internals,[21][22] Essential Node.js Security (2023) for security,[32] Testing Node.js Applications (2019) for testing,[35] and Build Your Own Web Server From Scratch In Node.JS (2024) for a reader who wants to see what a framework hides by writing a server without one.[24]

Developers coming from other stacks have their own entries. Getting MEAN with MEMEs (2015) addresses those who know the older combination of a scripting language and a relational database;[3] Hands-On AdonisJS v4. The Laravel Flavour Node Framework (2019) introduces a framework modelled on one from that world;[30] and Docker Recipes for Node.js Development (2017) is explicitly not for beginners, either in Node.js or in containers.[6]

History

Node.js was first released in 2009, combining the JavaScript engine of a web browser with a library for asynchronous input and output. Its package manager followed in 2010, and within a few years the registry behind it had become the largest of any language. A disagreement over governance produced a fork in 2014 that was merged back the following year under a foundation and a schedule of regular releases. The language itself gained a standard module syntax in 2015, which the runtime adopted slowly beside its own older one. Deno, a new runtime by Node's original author, appeared in 2020 with a security model based on permissions, and a third runtime followed.

The books register each stage. Getting MEAN with MEMEs (2015) belongs to the first enthusiasm, when a stack of four JavaScript tools was offered as the successor to the usual one and a new profession, the full-stack JavaScript developer, was said to have emerged.[3] The Beginners Guide To Node.js (2016) includes among its topics the runtime's versioning and the odd fact that its long-lived releases are named after chemical elements.[9] Learn Meteor - Node.js and MongoDB JavaScript platform (2017) and Practical Keystone.js (2016) document frameworks of the middle years.[4][7] Deno - A Complete Guide to Programming With Deno (2020) is a guide to the new runtime written in the year it appeared, starting from its architecture and its permissions.[25] The newest books treat the old divisions as settled or dissolving: Node.js and Express.js Simplified teaches both module systems side by side,[1] and The Native Era. Modern Node.js, Bun & Deno without Bundlers or Transpilers covers building for all three runtimes without the bundlers and transpilers that earlier books spent chapters on.[26]

The runtime and its internals

A Node.js program is ordinary JavaScript given access to things a browser withholds. The first exercise of Node.js and Express.js Simplified is a script that prints to the terminal, the point being only that JavaScript has run with no browser present; the book then shows the built-in option that reruns a program whenever its files change, and compares the two module systems.[1] Because much of Node's style depends on how JavaScript treats objects and functions, the two best-selling books teach the language as they go. The sample chapter of The Node Craftsman Book is on object orientation, which it says is quite simple in JavaScript and works completely differently from the same thing in other languages: where they build an object from a class, as from a blueprint, JavaScript has no classes and builds objects by pointing at other objects. The chapter's example is a car with a colour, a weight and the ability to drive and to sound its horn. In a class-based language thirty cars made from one class share those methods without their being written thirty times, and the chapter shows how JavaScript reaches the same economy by other means, first with functions that manufacture objects, then with constructor functions, then by sharing behaviour through prototypes.[2]

The event loop is the mechanism by which one thread serves many requests: work that must wait, for a file or a network reply, is handed off and its continuation queued. Node.js Event Loop is devoted to how the loop schedules work through its phases and queues and how to keep from blocking it.[21] Understanding Node.js stream module by implementing it from scratch explains streams, the runtime's way of handling data piece by piece, by building a simplified version of the module and giving the reason for each property and method.[22] The NodeJS Cluster Module (2017) covers the standard answer to the single thread, a module that starts a worker process for each processor core, so that a machine with eight cores is not left running one.[23]

Building web servers

The runtime includes an HTTP server, and the beginner's books start from it. The Node Beginner Book goes from a basic server through routing and the handling of requests to a complete small application.[19] Build Your Own Web Server From Scratch In Node.JS goes lower, starting from a bare network connection that echoes what it receives and working up through a messaging protocol to HTTP itself, static files and more, in TypeScript and with no dependencies.[24] The protocol has an adjacent book of its own. HTTP A Little Book (2018) was written by a programmer who found the existing texts too complicated and the standard forbidding, and who settled doubtful points by reading the source of Node's HTTP module; it introduces the architecture through sample code and then takes requests and responses apart piece by piece. The protocol was originally very simple, the author holds, and only the strict language of the standard makes it seem otherwise.[11]

Most applications use a framework above the built-in server. Mastering Node.js Backend Development: Build Crud app ( filter, search, sort) From Beginner to Production (2025) builds an interface for creating, reading, updating and deleting records with the commonest framework and a document database,[27] and Objection.js and Knex.js Guidebook (2020) does the same against relational databases.[28] An alternative to the conventional style of interface is a query language in which the client states exactly what data it wants. Fullstack GraphQL (2018), an adjacent book, sets out the case for it, that clients receive no more and no less than they ask for and can fetch nested resources in one request where the conventional style needs a cascade, and describes it as a typed language whose domain is data, in the way that the languages of styling and markup each have one domain. Because every field has a type, an interface written in it documents itself, and because less is sent in fewer requests, users on mobile networks are served better. The book teaches the stack layer by layer through a clone of a site for pinning images;[12] The Road to GraphQL (2021) teaches it from both client and server,[36] and How to Harness GraphQL with NestJS Like a Pro (2025) pairs it with a structured server framework.[29]

Frameworks

What a framework is for is explained by Practical Keystone.js: it helps a developer deliver an application sooner by imposing a style and a structure, usually based on a design pattern that separates the access to data, the business logic and the presentation. The framework it teaches follows a pattern of models, views and templates, close in conception to the pattern followed by the best-known frameworks of other languages; the model is the layer that defines the data and the ways of reaching and validating it. The book builds an application for tracking incident tickets with it.[7] Hands-On AdonisJS v4. The Laravel Flavour Node Framework walks through routing, middleware, controllers, views and sessions in another,[30] and Hapi.js Handbook (2019) is a set of self-contained tutorials on a third, readable in any order; the one in its sample shows functions that run in sequence before a route's main handler, each passing its result on to the next.[14]

Learn Meteor - Node.js and MongoDB JavaScript platform is about a platform that goes further and joins server, client and database. Its author, a teacher of long experience who prides the series on being as thin as possible, tells how the platform delivered a proof of concept in five days and then, for another project that needed low-level network access, let Node.js be reached directly; the chapter on why to use it, which begins with everything a developer needs being installed in one step on any common operating system, is followed by one headed with the question of where the catch is.[4] Deno - A Complete Guide to Programming With Deno covers the rival runtime's own framework for web interfaces among its projects.[25]

Full-stack JavaScript

Getting MEAN with MEMEs makes the argument for one language throughout. The familiar stack, it says, asks for JavaScript on the front end, another language on the back end and a query language for the database, quite apart from markup and styles, whereas a stack built on Node.js, a JavaScript framework for the server, another for the browser and a database that stores documents needs only one, so that a team can work across all the layers together. The book builds a small task list with the four and deploys it, after installing each part on three operating systems.[3] Snake Game for the Web is its authors' account of designing and building a multiplayer game with a Node.js server and a browser client,[31] and Awesome Coding has among its projects a command-line game and tools for the file system.[20]

Tooling and automation

Node.js is as much a tool for developers' own machines as a server. Automating with Node.js (2018) is written from the conviction that anything repetitive should ring an alarm: its author, noticing how much time went on updating tickets, zipping and mailing files and copying directories, spent a weekend writing commands to do them, and the book's first part is twenty such recipes, starting from the standard library. Its epigraph recommends giving a difficult job to a lazy person, who will find an easy way to do it.[5] The build tools that web projects depend on run on it as well, and the adjacent Webpack 2 (2017) configures one of them for a sample application.[17]

Deployment has Docker Recipes for Node.js Development, which assumes a reader who already runs Node.js applications in containers and has met the problems that follow, how to edit code that lives inside a container, how to attach a debugger, how to restart when files change. Its author describes a series of experiments in the relation between an image, a container and the host machine, and offers the results as solutions to specific problems where tutorials deliver only the parts; one recipe in the sample mounts the developer's files into the container on each of three operating systems, and another attaches an editor's debugger to the process inside.[6]

Security and testing

Three books are about security. Essential Node.js Security works through the risks to a web application built on the commonest framework, each described and then given a practical remedy drawn from open-source libraries;[32] Securing Node JS Apps (2016) is a short list of actionable steps, among them the sanitising of input and the hashing of passwords;[33] and Node.js Authentication & Authorization: From Zero to Production builds a complete authentication system step by step.[34]

Testing Node.js Applications covers the layout of a project and the testing of servers and of interfaces that require a login.[35] Testing through the browser, driven from Node.js, is the subject of two adjacent books. The Web App Testing Guidebook (2023) is candid about the costs as well as the benefits, the maintenance that automated interface tests demand and the features, animations among them, that resist testing, and about when to skip them, and it suggests a library of interface patterns as an easier first target than a whole application;[15] Selenium WebDriver Recipes in Node.js (2024) is a book of more than a hundred and seventy ready-to-run recipes, by an author who came to the JavaScript version of the tool with a prejudice against it and found it light, quick to set up and fast.[16] The Node Craftsman Book and Nodebots - Javascript and robotics in the real world both treat tests written first and continuous integration as part of ordinary practice.[2][8]

Hardware and industry

The runtime also drives devices. Nodebots - Javascript and robotics in the real world (2020) uses it to control a microcontroller board with simple, cheap sensors, and builds a light that reports the state of a software build and a fire alarm; its sample is concerned less with electronics than with engineering habits, checking the code on several operating systems and adding continuous integration, and the book promises attention to architecture and to connecting what a sensor reads with outside services.[8] In industrial automation, P4NR OPC UA for NodeJS (English) is a handbook on a protocol for exchanging process data and on its open-source implementation for Node.js. It begins with why a new protocol was needed: its predecessor of the 1990s let applications read data from any vendor's controller, but only on one operating system, within one network segment and without strict security. The book is careful about its own standing: it explains concepts and names that the standard's publishers have made public, points in every chapter to the authoritative text, and does not reproduce it.[10] An adjacent guide from the same series, PLUS for Node-RED - Contribution Modbus, connects a visual programming tool built on Node.js to an older industrial protocol.[18]

Questions about Node.js

Which Node.js book should I start with?

The classic first book is The Node Beginner Book (2018), a short tutorial that builds one small web application and teaches the necessary JavaScript on the way.[19] The Beginners Guide To Node.js (2016) is shorter still and assumes no programming at all, and Node.js and Express.js Simplified is a current beginner's guide from the runtime's fundamentals to a web framework.[9][1] A programmer who can already write basic applications should go on to The Node Craftsman Book (2017), which covers the package manager, test-driven development and databases.[2]

Is Node.js a framework or a programming language?

Node.js is neither a framework nor a programming language but an asynchronous, event-driven runtime environment that executes JavaScript outside a web browser.[1] It is made of a JavaScript engine, two module systems, interfaces to the operating system, the file system and the network, and an event loop, which together let the language be used for servers, command-line tools and scripts.[1]

What is the event loop in Node.js?

The event loop is the mechanism by which one thread serves many requests: work that must wait, for a file or a network reply, is handed off and its continuation queued. Node.js Event Loop (2025) is devoted to how the loop schedules work through its phases and queues, and it calls the blocking of the loop the silent killer of performance in production.[21]

Does Node.js use more than one processor core?

A program started in the ordinary way uses a single processor core and leaves the rest of the machine idle.[23] The standard answer is the cluster module, which starts a worker process for each core, and The NodeJS Cluster Module (2017) is a short book about it.[23]

Do I need a framework to build a web server in Node.js?

The runtime includes an HTTP server, and The Node Beginner Book (2018) goes from a basic server through routing and the handling of requests to a complete small application.[19] A framework, in the account of Practical Keystone.js (2016), helps a developer deliver an application sooner by imposing a style and a structure.[7] Build Your Own Web Server From Scratch In Node.JS (2024) shows what a framework hides by writing a server without one, in TypeScript and with no dependencies.[24]

What is Deno?

Deno is a newer runtime by Node's original author, which appeared in 2020 with a security model based on permissions. Deno - A Complete Guide to Programming With Deno (2020) is a guide written in the year it appeared, which starts from the runtime's architecture and its permissions and covers its own framework for web interfaces among its projects.[25]

Sources

Every source is a Leanpub book. The note after each says which part of it was read; where no sample was available, only the public description and table of contents were used.

  1. 1.
    Node.js and Express.js Simplified, CodeSweetly: A Practical Guide to Building, Testing, and Deploying Web Applications Free sample: the introduction and the first chapters, on what Node.js is, running a script and the module systems. 2026. Free sample: PDF · EPUB
  2. 2.
    The Node Craftsman Book, Manuel Kiessling: An advanced Node.js tutorial Free sample: the chapter on object-oriented JavaScript. 2017. Free sample: PDF · EPUB
  3. 3.
    Getting MEAN with MEMEs, Nikola Brežnjak: Deploying MEAN TODO application to production Free sample: the opening, on the stack and the case for one language, and the installation of its parts. 2015. Free sample: PDF · EPUB
  4. 4.
    Learn Meteor - Node.js and MongoDB JavaScript platform, Arnaud Weil: Be ready for coding away next week using Meteor Free sample: the introduction, the chapter on why to use the platform and the first application. 2017. Free sample: PDF · EPUB
  5. 5.
    Automating with Node.js, Shaun Michael Stone Free sample: the contents and the preface, on automating repetitive tasks. 2018. Free sample: PDF
  6. 6.
    Docker Recipes for Node.js Development, River Bailey: Solve common problems with simple solutions for Node.js in Docker! Free sample: the preface, on who should read the book, and two recipes. 2017. Free sample: PDF · EPUB
  7. 7.
    Practical Keystone.js, Manikanta Panati: A Hands On Introduction To Keystone.js Using a Real-World Project Free sample: the opening, on web frameworks and the pattern this one follows, and the setup. 2016. Free sample: PDF · EPUB
  8. 8.
    Nodebots - Javascript and robotics in the real world, Wilson Mendes Free sample: the introduction and the chapter on supporting several operating systems with continuous integration. 2020. Free sample: PDF · EPUB
  9. 9.
    The Beginners Guide To Node.js, Rick Hernandez: The practical guide to Node.js for new programmers Free sample: the preface, on who the book is for and what it does not cover. 2016. Free sample: PDF · EPUB
  10. 10.
    P4NR OPC UA for NodeJS (English), Klaus Landsdorf: Understanding and Using OPC UA, node-opcua, and Companion Specs with Node.js 24 Free sample: the preface and conventions, and the opening of the history of the protocol. 2026. Free sample: PDF · EPUB
  11. 11.
    HTTP A Little Book, Reco Free sample: the foreword and the introduction, with a first request and response. 2018. Free sample: PDF · EPUB
  12. 12.
    Fullstack GraphQL, Julián Mayorga Free sample: the preface, on what the query language is and its benefits, and the first queries. 2018. Free sample: PDF · EPUB
  13. 13.
    Code to Career: JavaScript & Node.js from Zero to Professional, Mert Turedu: A Complete Guide to Modern JavaScript, Node.js, Backend Development, APIs, Databases, Security, and Real-World Projects Free sample: the foreword and the notes on who the book is for and how to read it. 2026. Free sample: PDF · EPUB
  14. 14.
    Hapi.js Handbook, Roman Akhromieiev: Collection of useful tutorials about Hapi.js framework. Free sample: one short tutorial, on functions that run before a route's handler. 2019. Free sample: PDF
  15. 15.
    The Web App Testing Guidebook, Kevin Lamping: UI Testing of Real World Websites Using WebdriverIO Free sample: the opening chapter, on the benefits and drawbacks of automated interface testing. 2023. Free sample: PDF · EPUB
  16. 16.
    Selenium WebDriver Recipes in Node.js, Zhimin Zhan: The problem solving guide to Selenium WebDriver in JavaScript Free sample: the preface, on why the author wrote a JavaScript edition. 2024. Free sample: PDF · EPUB
  17. 17.
    Webpack 2, Sha Alibhai: A Build Tool for Modern JavaScript Applications The free sample was not used: from the description and table of contents. 2017. Free sample: PDF · EPUB
  18. 18.
    PLUS for Node-RED - Contribution Modbus, Klaus Landsdorf (Iniationware, P4NR), Kay Grewe, Mohammed Yachou, JohnOtten: The Open Source Modbus Tools The free sample was not used: from the description and table of contents. 2026. Free sample: PDF · EPUB
  19. 19.
    The Node Beginner Book, Manuel Kiessling: A comprehensive Node.js tutorial No sample: from the description and table of contents. 2018.
  20. 20.
    Awesome Coding, Engin Arslan: Build Cool Stuff with JavaScript and Node.js No sample: from the description and table of contents. 2023.
  21. 21.
    Node.js Event Loop, A. Jobaer: Mastering Concurrency with Asynchronous Patterns and Non-Blocking Design in Node.js No sample: from the description and table of contents. 2025.
  22. 22.
    Understanding Node.js stream module by implementing it from scratch, Babak Gholamzadeh: Implement a simplified and minimalist version of the Node.js stream module from scratch to understand the workflow of this module No sample: from the description. 2021.
  23. 23.
    The NodeJS Cluster Module, Antonio Santiago No sample: from the description and table of contents. 2017.
  24. 24.
    Build Your Own Web Server From Scratch In Node.JS, build-your-own.org: Learn network programming, HTTP, and WebSocket by coding a Web Server No sample: from the description and table of contents. 2024.
  25. 25.
    Deno - A Complete Guide to Programming With Deno, Jana Bergant: Software development with Deno No sample: from the description and table of contents. 2020.
  26. 26.
    The Native Era. Modern Node.js, Bun & Deno without Bundlers or Transpilers, Edgar Milvus No sample: from the description alone. 2026.
  27. 27.
    Mastering Node.js Backend Development: Build Crud app ( filter, search, sort) From Beginner to Production, Roberto Stepic: From Beginner to Professional: Build Secure, Scalable REST APIs with MongoDB, JWT, and Expres No sample: from the description and table of contents. 2025.
  28. 28.
    Objection.js and Knex.js Guidebook, Advena: A step-by-step guide to build basic REST API’s with Objection.js, Knex.js, Express.js, NodeJS and relational databases using best practices. No sample: from the subtitle; the description and table of contents are empty. 2020.
  29. 29.
    How to Harness GraphQL with NestJS Like a Pro, Idris Bankole No sample: from a one-paragraph description. 2025.
  30. 30.
    Hands-On AdonisJS v4. The Laravel Flavour Node Framework, Champ Ramentio No sample: from the description and table of contents. 2019.
  31. 31.
    Snake Game for the Web, Jaakko Vanhala, Anssi Gröhn: Journey into Nodejs, HTML5, CSS3, MySQL & Docker No sample: from the description and table of contents. 2026.
  32. 32.
    Essential Node.js Security, Liran Tal: for Express Web Applications No sample: from the description alone. 2023.
  33. 33.
    Securing Node JS Apps, Ben Edmunds: is your Node JS app truly secure? Let's make sure you get home on time and sleep well at night. No sample: from the description and table of contents. 2016.
  34. 34.
    Node.js Authentication & Authorization: From Zero to Production, Roberto Stepic: Build Secure, Real-World Auth Systems with JWT, Email Verification, Password Recovery, Role-Based Access, and Testing No sample: from the description and table of contents. 2026.
  35. 35.
    Testing Node.js Applications, Pascal Maniraho No sample: from the description and table of contents. 2019.
  36. 36.
    The Road to GraphQL, Robin Wieruch: Your journey to master GraphQL in JavaScript No sample: from the description and table of contents. 2021.

Further reading

Other books in the library on neighbouring ground, not cited above.

  • The Pulumi Book, Christian Nunciato: A developer's guide to programming the cloud with TypeScript and Amazon Web Services Infrastructure as code for full-stack developers, with programs written in TypeScript. 2026. Free sample: PDF · EPUB
  • Practical Aurelia, Behzad Abbasi: Real-world examples of using Aurelia in multiple scenarios and platforms Single-page applications with one front-end framework, with a Node.js back end added later. 2018.
  • Making Multiplayer Online Games, Stephen Gose: A Game Development Workbook for any JavaScript Gaming Framework. A workbook for building a multiplayer online game with any JavaScript game framework. 2021.
  • JavaScript glossary on demand, Andrea Giammarchi: a mini guide to modern JavaScript programming through common terminology explanation JavaScript explained through its terms, introduced as they are needed. 2016.
  • JavaScript Awesome Tips, Caio Ribeiro Pereira: A collection of tips and tricks for JavaScript A short cookbook of JavaScript problems and solutions. 2019. Free sample: PDF · EPUB
  • Kubernetes & Orchestration. Deploying Scalable Node.js & AI Clusters without Tears, Edgar Milvus Container orchestration for JavaScript and TypeScript developers. 2026.

This is an article created from the free samples of 16 Leanpub books and the descriptions and tables of contents of 20 more. We're building these articles to provide you, the Leanpub reader, with a good jumping-off point to discover more Leanpub books that are interesting and relevant to you. We never use material which is paid-only when building these articles: we only use material which is already free on Leanpub. However, Leanpub authors can opt out from inclusion in articles from their book settings page.

Updated November 2026.

In the Leanpub store: 106 books in the Node.js category · also filed under Express, Deno, Meteor

All topics