The asynchronous development style using callbacks that is a recurring pattern in JavaScript and Node.js applications can at times result in a code structure that is hard to understand. Applying the event emitter pattern comes in handy in situations where more than one callback event must be handled, resulting in a cleaner code structure that is easier to follow and reason about. The pattern is so useful that we should use it for our own objects and functions where it makes sense, something that's made easy by utilizing the existing util.inherits class.
The Node Craftsman Book
By :
The Node Craftsman Book
By:
Overview of this book
The Node Craftsman Book helps JavaScript programmers with basic Node.js knowledge to now thoroughly master Node.js and JavaScript. This book dives you deeper into the craft of software development with Node.js and JavaScript, incuding object-orientation, test-driven development, database handling, web frameworks, and much more.
The Node Craftsman Book shows you how to work with Node.js and how to think deeply about how you build your Node projects. You'll master how to build a complete Node.js application across six crafting milestones, and you'll learn many specific skills to achieve that mastery. These skills include how to work with the Node Package Manager in depth, how to connect your Node applications to databases, and how to write unit tests and end-to-end tests for your code. You'll experience the full Node.js development picture, and learn how to craft and control your Node.js applications - right through to fully-fledged web applications using REST, and integration with Angular applications.
Table of Contents (17 chapters)
Free Chapter
Part 1: Node.js Basics in Detail
Working with NPM and Packages
Test-driven Node.js Development
Object-oriented JavaScript
Synchronous and Asynchronous Operations Explained
Using and Creating Event Emitters
Optimizing Code Performance and Control Flow Management Using the Async Library
Node.js and MySQL
Node.js and MongoDB
Part 2: Building a Complete Web Application with Node.js and Angular
Milestone 1 – A First Passing Test Against the Server
Milestone 2 – The API Responds with Actual Database Content
Milestone 3 – Setting the Stage for a Continuous Delivery Workflow
Milestone 4 – Giving Users a Frontend
Milestone 5 – More Work on the Backend
Milestone 6 – Completing the Backend and Finalizing the Application
Customer Reviews