Node Streams for APIs
Node streams are a fantastic abstraction for evented programming. They’re also
notoriously hard to implement. In this post, I’d like to walk through
implementing a streams2 Readable
stream to wrap
an API.
The API
Suppose we have a web service that returns a list of customers. There might be a
large number of customers, so this service paginates the results and expects us
to provide a page number when requesting data. A sample request to the API might
look something like the line below.
blog.drewolson.org