JavaScript with Promises
136 pages
English
PDF
4.5

JavaScript with Promises

JavaScript with Promises

Author:

Year:

Summary:

Introduction

The book "JavaScript with Promises" by Daniel Parker was published in 2015 and immediately carved out a niche as a compact yet comprehensive guide to asynchronous programming in JavaScript. Despite its small size (only 136 pages), the publication covers key concepts of working with promises — from basics to advanced patterns. The book is focused on the Node.js environment, but all examples are also applicable in browser JavaScript. For the educational site pythonlib.ru, this review will help readers understand whether it's worth their time to read this book if they are already familiar with JS syntax but want to deeply understand asynchronicity.

What This Book Is About

"JavaScript with Promises" is not just a reference guide to the then, catch, and Promise.all methods. Parker systematically reveals the evolution of asynchronous code: from callbacks (callback hell) through promises to generators and async/await (the latter are mentioned as a future prospect). The main focus is on:

  • Creating and composing promises;
  • Error handling in asynchronous chains;
  • Parallel and sequential task execution;
  • Integrating promises with existing callback-based code;
  • Testing asynchronous code.

Each chapter contains practical examples in Node.js that can be run immediately. The book is written concisely, without fluff — every paragraph carries meaning.

Who This Book Is For

The publication is aimed at developers already familiar with the basics of JavaScript (variables, functions, objects) and having minimal experience with Node.js. Beginners just starting to learn JS will find the book difficult due to the lack of an introduction to syntax. However, for those who have already written simple scripts and encountered the problem of "callback hell," this book will be a lifesaver.

What the Reader Will Learn

After reading, you will be able to:

  • Understand how a promise differs from a regular callback and why it matters;
  • Create your own promises based on asynchronous operations (file reading, HTTP requests);
  • Manage promise chains, avoiding nesting;
  • Handle errors centrally without losing context;
  • Combine promises using Promise.all, Promise.race, and Promise.allSettled;
  • Rewrite old callback-based code into a modern asynchronous style;
  • Test asynchronous functions using mocks and fake timers.

Strengths of the Book

The first thing that stands out is structure. Parker doesn't jump from topic to topic but builds a logical ladder: from simple to complex. The second is practical focus. Almost every example can be copied and run to see the result. The third is emphasis on error handling. In real projects, this topic raises the most questions, and the author devotes an entire chapter to it. Finally, the book has not become outdated: although async/await has appeared since 2015, promises remain the foundation, and understanding their inner workings is necessary for the proper use of modern syntax.

Who It Is Recommended For

I recommend this book to:

  • Frontend developers who want to write clean asynchronous code without callbacks;
  • Backend developers on Node.js working with the file system, databases, or APIs;
  • Teachers looking for compact material for a course on asynchronous JS;
  • Anyone transitioning from other languages (e.g., Python) to JavaScript and wanting to understand the specifics of asynchronicity.

If you already confidently use async/await and do not plan to support older projects, the book may

Recommendations