Registry / data / ix
library0.0.7jsnpmunverified

IxJS, currently stable at version 7.0.0, is a JavaScript library providing the "Interactive Extensions" for composing synchronous and asynchronous pull-based collections. It extends the familiar Array#extras style (like map, filter, reduce) to native JavaScript `Iterable` and `AsyncIterable` objects, as well as generators and async generators. Unlike push-based reactive libraries such as RxJS, IxJS focuses on consumer-driven data flow, making it particularly well-suited for I/O operations where data is pulled when ready. The library offers distinct modules for synchronous (`ix/iterable`) and asynchronous (`ix/asynciterable`) operations, supporting both pipeable operators and a prototype-extension approach for bundling flexibility. It ships with full TypeScript type definitions and maintains a steady release cadence, typically with minor versions for features and bug fixes, with major versions addressing internal changes or deeper refactorings.

npm install ix
INSTALL
IMPORT
SIG · IX
I
ix
datajavascriptv0.0.7
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

from
import { from } from 'ix/iterable';
import { from } from 'ix';
Use the specific `ix/iterable` or `ix/asynciterable` path for the `from` creation function, not the root package.
pipeable operators
import { filter, map } from 'ix/iterable/operators';
import { filter, map } from 'ix';
Pipeable operators are imported from `ix/iterable/operators` for synchronous operations or `ix/asynciterable/operators` for asynchronous operations. Do not import directly from the root `ix` package.
IterableX / AsyncIterableX
import { IterableX } from 'ix/iterable'; import { AsyncIterableX } from 'ix/asynciterable';
const { IterableX } = require('ix/iterable'); // CommonJS is supported, but ESM is preferred in modern applications.
The `IterableX` and `AsyncIterableX` classes are the core types for working with these extensions. Use `IterableX` for synchronous and `AsyncIterableX` for asynchronous.
Prototype extensions
import 'ix/add/iterable/of'; import 'ix/add/iterable-operators/map';
import { map } from 'ix/add/iterable-operators/map';
To extend `IterableX` or `AsyncIterableX` prototypes, use side-effect imports from `ix/add/...`. These are global modifications and should be used with caution, typically for bundling scenarios where tree-shaking isn't as effective.

Demonstrates creating a synchronous `Iterable` from a generator function and transforming it using pipeable `filter` and `map` operators, then iterating through the results.

import { from } from 'ix/iterable'; import { filter, map } from 'ix/iterable/operators'; // A synchronous generator function function* numberGenerator() { yield 1; yield 2; yield 3; yield 4; yield 5; yield 6; } // Create an Iterable from the generator and apply pipeable operators const results = from(numberGenerator()).pipe( filter(x => x % 2 === 0), // Keep only even numbers map(x => x * 10) // Multiply by 10 ); console.log('Synchronous Iterable results:'); for (const item of results) { console.log(`Next: ${item}`); } // To demonstrate AsyncIterable, imagine an async data source // import { from as asyncFrom } from 'ix/asynciterable'; // import { filter as asyncFilter, map as asyncMap } from 'ix/asynciterable/operators'; // async function* asyncNumberGenerator() { // for (let i = 1; i <= 6; i++) { // await new Promise(resolve => setTimeout(resolve, 50)); // yield i; // } // } // async function runAsyncExample() { // const asyncResults = asyncFrom(asyncNumberGenerator()).pipe( // asyncFilter(x => x % 2 !== 0), // Keep only odd numbers // asyncMap(x => x + 100) // Add 100 // ); // console.log('\nAsynchronous Iterable results:'); // for await (const item of asyncResults) { // console.log(`Next Async: ${item}`); // } // } // runAsyncExample();
Debug
Known issues
gotchaIxJS maintains separate modules for synchronous (`ix/iterable`) and asynchronous (`ix/asynciterable`) operations. Mixing operators or creators from these distinct modules on the wrong type of iterable will lead to runtime errors or incorrect behavior.
fix
Always ensure you are importing from either `ix/iterable` for sync operations or `ix/asynciterable` for async operations, and their respective `operators` submodules.
affects: >=4.0.0
gotchaMajor version updates (e.g., v5.0.0, v6.0.0, v7.0.0) in IxJS often contain internal refactorings and bug fixes. While explicit breaking API changes might not always be prominently documented, minor behavioral changes or stricter type checks can occur, potentially affecting edge cases.
fix
Thoroughly test your application when upgrading major versions. Refer to the GitHub release notes and commit history for subtle behavioral changes or type definition improvements.
affects: >=5.0.0
deprecatedThe pattern of directly importing side-effect modules (e.g., `import 'ix/add/iterable-operators/map';`) to extend prototypes is less common in modern applications favoring tree-shaking. While supported, it can lead to larger bundle sizes if not all added operators are used.
fix
Prefer using pipeable operators by importing them directly (e.g., `import { map } from 'ix/iterable/operators';`) and composing them with the `.pipe()` method on your iterable instances. This enables better tree-shaking and avoids global prototype modifications.
affects: >=4.0.0
Errors
Common errors & fixes
TypeError: (some operator) is not a function
Attempting to use an operator (e.g., `map`, `filter`) directly on an `IterableX` or `AsyncIterableX` instance without either importing it as a pipeable operator or adding it via the prototype extension.
fix
Ensure the operator is imported from `ix/iterable/operators` (or `ix/asynciterable/operators`) and used with the `.pipe()` method, or that the corresponding `ix/add/...` module has been imported for prototype extension.
TypeError: Cannot read property 'Symbol.asyncIterator' of undefined
Attempting to use an asynchronous operator or an `AsyncIterableX` method on a synchronous `Iterable` or a non-async data source.
fix
Verify that your data source is truly asynchronous (e.g., an `AsyncGenerator`, `Promise` of an `Iterable`) and that you are consistently using imports from `ix/asynciterable` and `ix/asynciterable/operators`.
SyntaxError: Named export 'from' not found. The requested module 'ix' does not provide an export named 'from'.
Incorrect import path for creation functions or operators; these are not directly exposed from the root `ix` package.
fix
Always use specific import paths for creators and operators, such as `import { from } from 'ix/iterable';` or `import { map } from 'ix/asynciterable/operators';`.
Upgrade
Version history
0.0.7latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
ix — npm install ix · libregistry