Description
Basic operations on synchronous + asynchronous iterables, strictly for JavaScript native types.
We do not use any synthetic types / wrappers here, like Observable in RXJS, etc. It is strictly an iterable on the input, and an iterable on the output, for maximum performance, simplicity and compatibility (see Rationale).
We also do not use ES6 generators internally, because their current implementation in V8 is relatively slow.
#<Sawyer::Resource:0x00007fbac98da410> alternatives and similar libraries
Based on the "Editors" category.
Alternatively, view iter-ops alternatives based on common mentions on social networks and blogs.
-
TinyMCE
The world's #1 JavaScript library for rich text editing. Available for React, Vue and Angular -
medium-editor
Medium.com WYSIWYG editor clone. Uses contenteditable API to implement a rich text solution. -
CKEditor 5
Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing. -
SimpleMDE
A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving and spell checking. -
wysihtml5
DISCONTINUED. Open source rich text editor based on HTML5 and the progressive-enhancement approach. Uses a sophisticated security concept and aims to generate fully valid HTML5 markup by preventing unmaintainable tag soups and inline styles. -
EpicEditor
EpicEditor is an embeddable JavaScript Markdown editor with split fullscreen editing, live previewing, automatic draft saving, offline support, and more. For developers, it offers a robust API, can be easily themed, and allows you to swap out the bundled Markdown parser with anything you throw at it. -
Materio Free Vuetify VueJS Admin Template
Production Ready, Carefully Crafted, Extensive Vuetifty Free Admin Template 🤩 -
Bangle.dev
Collection of higher level rich text editing tools. It powers the local only note taking app https://bangle.io -
Everright-formEditor
:guide_dog: Powerful lowcode|vue form editor,generator,designer,builder library. It provides an easy way to create custom forms. The project is extensible, easy to use and configure, and provides many commonly used form components and functions(vue可视化低代码表单设计器、表单编辑器、element-plus vant表单设计) -
data-structure-typed
Javascript Data Structure & TypeScript Data Structure. Heap, Binary Tree, Red Black Tree, Linked List, Deque, Trie, HashMap, Directed Graph, Undirected Graph, Binary Search Tree, AVL Tree, Priority Queue, Graph, Queue, Tree Multiset, Singly Linked List, Doubly Linked List, Max Heap, Max Priority Queue, Min Heap, Min Priority Queue, Stack. -
React Chat UI
Build your own chat UI with React Chat UI components in a few minutes. React Chat UI Kit from minchat.io is an open source UI toolkit for developing web chat applications.
CodeRabbit: AI Code Reviews for Developers
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of #<Sawyer::Resource:0x00007fbac98da410> or a related project?
README
iter-ops
About
Basic operations on synchronous + asynchronous iterables, strictly for JavaScript native types.
We do not use any synthetic types / wrappers here, like Observable
in RXJS, etc. It is strictly an iterable on the
input, and an iterable on the output, for maximum performance, simplicity and compatibility (see Rationale).
Installation
$ npm i iter-ops
Usage
- Synchronous pipeline:
import {pipe, filter, map} from 'iter-ops';
const input = [1, 2, 3, 4, 5];
const i = pipe(
input,
filter((a) => a % 2 === 0), // find even numbers
map((value) => ({value})) // remap into objects
);
console.log(...i); //=> {value: 2}, {value: 4}
- Asynchronous pipeline:
import {pipe, toAsync, distinct, delay} from 'iter-ops';
const input = [1, 2, 2, 3, 3, 4];
const i = pipe(
toAsync(input), // make asynchronous
distinct(), // emit unique numbers
delay(1000) // delay each value by 1s
);
// or you can replace `pipe` + `toAsync` with just `pipeAsync`
(async function () {
for await (const a of i) {
console.log(a); //=> 1, 2, 3, 4 (with 1s delay)
}
})();
See also...
- API List below, plus Full API
- Recipes, for additional operations
- [Benchmarks], for performance comparison
API
Function pipe takes any iterable, applies all specified operators to it, and returns an extended iterable. For strict type of iterables, there are also pipeSync and pipeAsync.
Standard operators:
All standard operators implement the same logic as Array does:
- concat - merges current iterable with multiple values, iterators or iterables.
- every - checks if all elements pass the predicate test.
- filter - standard filter processor, filtering by predicate.
- flat - flattens/expands sub-iterable elements.
- flatMap - remaps + flattens sub-iterable elements.
- map - standard mapping processor, remapping by predicate.
- reduce - standard reduce processor.
- some - checks if any element passes the predicate test.
Extended operators:
- aggregate - executes an aggregate on accumulated values - see Aggregates.
- catchError - catches iteration errors - see Error Handling.
- count - counts values, and produces a one-value iterable.
- defaultEmpty - adds default to an empty iterable.
- distinct - emits unique values, with optional key selector.
- drain - drains the iterable, and then ends it.
- empty - produces an empty iterable.
- first - produces a one-value iterable, with the first emitted value.
- indexBy - emits indexed values that pass the predicate test.
- isEmpty - produces a one-value iterable, indicating if the source is empty.
- last - produces a one-value iterable, with the last emitted value.
- onEnd - notifies of the end of a successful iteration.
- page - splits values into pages of fixed size (last page can be smaller).
- repeat - repeats iterable values.
- skip - starts emitting values after certain count.
- split - splits values into separate lists - see Split.
- spread - spreads iterable values.
- start - starts emitting, once the predicate returns a truthy value.
- stop - stops emitting, once the predicate returns a truthy value.
- take - emits up to certain number of values.
- takeLast - emits up to certain number of the last values.
- tap - taps into each value, without changing the output.
- timeout - ends iteration after N milliseconds.
- timing - measures timings for each value.
- toArray - accumulates values into an array.
- zip - zips values together, into an array.