Node.js design patterns : get the best out of Node.js by mastering a series of patterns and techniques to create modular, scalable, and efficient applications /


Mario Casciaro ; cover image by Artie Ng.
Bok Engelsk 2014 · Electronic books.
Medvirkende
Ng, Artie, ( cover designer. )
Omfang
1 online resource (454 p.)
Utgave
1st edition
Opplysninger
Includes index.. - Cover; Copyright; Credits; About the Author; Acknowledgments; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Node.js Design Fundamentals; The Node.js philosophy; Small core; Small modules; Small surface area; Simplicity and pragmatism; The reactor pattern; I/O is slow; Blocking I/O; Non-blocking I/O; Event demultiplexing; The reactor pattern; The non-blocking I/O engine of Node.js - libuv; The recipe for Node.js; The callback pattern; The continuation-passing style; Synchronous continuation-passing style; Asynchronous continuation-passing style. - Executing a known set of tasks in sequenceSequential iteration; Parallel execution; Web spider version 3; The pattern; Fixing race conditions in the presence of concurrent tasks; Limited parallel execution; Limiting the concurrency; Globally limiting the concurrency; The async library; Sequential execution; Sequential execution of a known set of tasks; Sequential iteration; Parallel execution; Limited parallel execution; Promises; What is a promise?; Promises/A+ implementations; Promisifying a Node.js style function; Sequential execution; Sequential iteration. - Exporting a constructorExporting an instance; Modifying other modules or the global scope; The observer pattern; The EventEmitter; Create and use an EventEmitter; Propagating errors; Make any object observable; Synchronous and asynchronous events; EventEmitter vs Callbacks; Combine callbacks and EventEmitter; Summary; Chapter 2: Asynchronous Control Flow Patterns; The difficulties of asynchronous programming; Creating a simple web spider; The callback hell; Using plain JavaScript; Callback discipline; Applying the callback discipline; Sequential execution. - Non continuation-passing style callbacksSynchronous or asynchronous?; An unpredictable function; Unleashing Zalgo; Using synchronous APIs; Deferred execution; Node.js callback conventions; Callbacks come last; Error comes first; Propagating errors; Uncaught exceptions; The module system and its patterns; The revealing module pattern; Node.js modules explained; A homemade module loader; Defining a module; Defining globals; module.exports vs exports; require is synchronous; The resolving algorithm; The module cache; Cycles; Module definition patterns; Named exports; Exporting a function. - Sequential iteration - the patternParallel execution; Limited parallel execution; Generators; The basics; A simple example; Generators as iterators; Passing values back to a generator; Asynchronous control flow with generators; Generator-based control flow using co; Sequential execution; Parallel execution; Limited parallel execution; Producer-consumer pattern; Limiting the download tasks concurrency; Comparison; Summary; Chapter 3: Coding with Streams; Discovering the importance of streams; Buffering vs Streaming; Spatial efficiency; Gzipping using a buffered API; Gzipping using streams. - Time efficiency. - If you're a JavaScript developer interested in a deeper understanding of how to create and design Node.js applications, this is the book for you.
Emner
Sjanger
Dewey
ISBN
1-78328-732-2

Bibliotek som har denne