Except, I can't just pass a `.each` function to one of the hundreds of existing stream related utilities that have been published on npm. I can't use flow control or destroy the iterator once I've read enough data, unlike a stream.
On Thu, Jul 20, 2017, 09:33 Geoffrey Cox <redge...@gmail.com> wrote: > Hi Sean, > > Sure, you could use a stream, but you'd probably end up writing a bunch of > code to do what you can do in just a few lines with slouch. > > For example, here is an example of using the _all_docs API in nano: > https://github.com/redgeoff/slouch/blob/master/examples/nano-all.js > > And here is a similar example using slouch: > https://github.com/redgeoff/slouch/blob/master/examples/all.js > > Slouch really gets cool when you start using a Throttler to provide some > concurrency without totally slamming your CPU: > > https://github.com/redgeoff/slouch/wiki/Don%27t-just-relax.-Slouch%21#example-2---process-a-max-of-5-docs-concurrently > > > Geoff > > > > On Wed, Jul 19, 2017 at 10:26 PM Sean Lang <slang...@gmail.com> wrote: > > > `.each` is kinda weird for iteration. Can't you just return a standard > > Node.js stream? > > > > On Wed, Jul 19, 2017, 09:31 Geoffrey Cox <redge...@gmail.com> wrote: > > > > > Hi, > > > > > > We just released, Slouch, another JS client for CouchDB. On the > surface, > > it > > > may seem like we have reinvented the wheel as there is already nano and > > > nano is pretty awesome. However, Slouch approaches things from a > slightly > > > different perspective and has allowed us to greatly simply our > > application > > > layer. > > > > > > You can read more about it on medium. > > > < > > > > > > https://medium.com/@redgeoff/dont-just-relax-slouch-a-js-client-for-couchdb-that-does-the-heavy-lifting-d8232eba8e2c > > > > > > > > > > Or, jump straight the repo. <https://github.com/redgeoff/slouch> > > > > > > I welcome any feedback and hope this helps others. > > > > > > Thanks. > > > > > > Geoff > > > > > >