All languages

JavaScript

You're viewing a free preview. Sign in free to read every script.

Why this exists Node is built on two ideas. The first is sequences of values : lines from a file, pages from an API, rows from a query. The second is events : a server that emits request, a stream that emits data and…

JavaScript Basics: Iterators, Generators, Async Iteration and EventEmitter

Two patterns behind much of Node: iterating lazily (iterators, generators, for await over paged results) and reacting to events (EventEmitter: on, once, off, the special error event, awaiting an event, and the listener-leak warning), each with real output.

Sign in free to read this script, along with the rest of the library.

Sign in free