Not convinced? Try Sequency right in your browser.
Getting startedDownload the latest release from GitHub or install Sequency from NPM:
npm install --save sequency
Alternatively use Sequency from CDN by adding this to your HTML:
How Sequency worksSequency is centered around a single class called
Sequence to process any kind of iterable data such as arrays, sets or maps. The API is inspired by Kotlin Sequences.
Sequences can be created by utilizing one of the following functions:
} from 'sequency';
sequenceOfaccepts one or many values and returns a new sequence.
asSequenceaccepts an iterable (e.g. an array, set or map) and returns a new sequence.
emptySequencereturns a new empty sequence.
rangereturns as number sequence consisting of all numbers between
generateSequencereturns a sequence generated from the given generator function.
extendSequenceallows extending sequences with user-defined operations (see example).
Sequence provides a fluent functional API consisting of intermediate and terminal operations. Intermediate functions (e.g.
sorted) return a new sequence, thus enabling method chaining. Terminal functions (e.g.
findLast) return an arbitrary result. Detailed descriptions of all operations are available in the API docs.
Sequences are lazily evaluated to avoid examining all of the input data when it's not necessary. Sequences always perform the minimal amount of operations to gain results. E.g. in a
filter - map - find sequence both
find are executed just one time before returning the single result.The docs are also available online. When using an IDE like Intellij IDEA or Webstorm the docs are available inline right inside your editor.