Book Image

Node Cookbook - Third Edition

By : David Mark Clements, Mathias Buus Madsen, Peter Elger, Matteo Collina
Book Image

Node Cookbook - Third Edition

By: David Mark Clements, Mathias Buus Madsen, Peter Elger, Matteo Collina

Overview of this book

Today's web demands efficient real-time applications and scalability. Asynchronous event-driven programming is ideal for this, and this is where Node.js comes in. Server-side JavaScript has been here since the 90s, but Node got it right. With Node for tooling and server-side logic, and a browser-based client-side UI, everything is JavaScript. This leads to rapid, fluid development cycles. The full-stack, single language experience means less context-switching between languages for developers, architects and whole teams. This book shows you how to build fast, efficient, and scalable client-server solutions using the latest versions of Node. The book begins with debugging tips and tricks of the trade, and how to write your own modules. Then you'll learn the fundamentals of streams in Node.js, discover I/O control, and how to implement the different web protocols. You'll find recipes for integrating databases such as MongoDB, MySQL/MariaDB, Postgres, Redis, and LevelDB. We also cover the options for building web application with Express, Hapi and Koa. You will then learn about security essentials in Node.js and advanced optimization tools and techniques. By the end of the book you will have acquired the level of expertise to build production-ready and scalable Node.js systems. The techniques and skills you will learn in this book are based on the best practices developed by nearForm, one of the leaders in Node implementations, who supported the work of the authors on this book.
Table of Contents (12 chapters)

Preface

The principles of asynchronous event-driven programming are perfect for today's web, where efficient, high-concurrency applications are essential for good user experience and a company's bottom line.

The use of Node for tooling and server-side logic with a browser-based, client-side UI leads to a full-stack unilingual experience--everything is JavaScript. This saves developers, architects, project leads, and entire teams the cognitive energy of context-switching between languages, and yields rapid, fluid development cycles.

With a thriving community and success stories and investment from major organizations (such as Netflix, IBM, Capital One, Groupon, RedHat, PayPal, Fidelity, and more), Node.js is relevant to enthusiasts, start-ups, and enterprises alike.

Since the publication of the first edition of Node Cookbook, the technology, community, thinking, and industry around Node.js has taken significant steps forward. On top of that, the first edition was introductory in nature when it was published; Node.js was new, and there were few developers working with it on a daily basis. These days, developer mindshare around Node.js is widespread, allowing for a higher level of assumed basic understanding. To that end, Node Cookbook, Third Edition is an (almost) complete rewrite of Node Cookbook. It covers far more territory than the first and second edition, with dedicated chapters on debugging, performance, microservices, and deployment (all the topics that are either alluded to or not covered in the former editions). Node Cookbook, Third Edition, not only benefits from the enhanced experience and knowledge acquired by the original author since the first edition was written, but also draws on the expertise of coauthors Mathias Buus, Matteo Collina, and Peter Elger, who provide content for some of the high value chapters in this book.