sync/async generators and helpers to form typed linq-like iterable queries
this is an experimental package and subject to change on minors versions
install with either npm or yarn:
npm install pipeline-linq
yarn add pipeline-linq
pipeline-linq @ < 1.0, this package, when imported, will polyfill the
linq is a helper function used to wrap and chain pipeline methods together. Simply pass through an object that implements
[Symbol.iterator], this includes
 or any typed-array.
By default the call to
linq returns the synchronous query, you can switch to the async equivalents by passing through
true at the end of most supporting methods.
Converting to an async query will cause all subsequent method calls to be evaluated using the
Symbol.asyncIterator and you must await the resulting promise or use
for-await to iterate the query.
note: when using
linqthe evaluation of the iterators is lazy, thus you can iterate over
You can use the sync generators directly by importing them:
The Linq and LinqAsync interfaces have a method
chain that can be used to insert custom iterators into the iterator sequence.
A custom filter method:
It is also possible to insert complex queries:
see proposal pipeline-operator
Subject to change. All generators and helper methods take the source as the first parameter and so will be readily available to use with the pipeline operator. For now, you could use the babel transformer and use:
;|> where_, x > 2|> select_, x * 2|> first;