Registry / http-networking / rx-lite

rx-lite

JSON →
library4.0.8jsnpmunverified

rx-lite is a lightweight distribution of the Reactive Extensions for JavaScript (RxJS) version 4.x, primarily used for composing asynchronous and event-based operations in JavaScript. At version 4.0.8, it provided a core set of observable operators for handling events, promises, callbacks, and time-based operations in both modern browser environments (IE9+) and Node.js. The library was part of an earlier generation of RxJS, with its development repository transitioning to 'RxJS vNext' (which became RxJS v5 and later) after the 4.x series. This version prioritizes a compact bundle (`rx.lite.js`) for everyday use cases, differing from the more modular, tree-shakable approach adopted in subsequent major RxJS releases. It had an irregular release cadence, focusing on bug fixes and performance improvements within the 3.x and 4.x lines before the major architectural shift to modern RxJS.

npm install rx-lite
INSTALL
IMPORT
SIG · RX-LITE
R
rx-lite
http-networkingjavascriptv4.0.8
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.

Rx
const Rx = require('rx-lite');
import Rx from 'rx-lite';
RxJS v4 is a CommonJS module for Node.js. ESM import syntax is not supported and will fail.
Observable
const Rx = require('rx-lite'); const Observable = Rx.Observable;
import { Observable } from 'rx-lite';
Observable is a property of the global 'Rx' object, not a named export.
fromPromise
const Rx = require('rx-lite'); const myObservable = Rx.Observable.fromPromise(somePromise);
import { fromPromise } from 'rx-lite';
Operators are attached to Rx.Observable. Named ESM imports are not available in this version.

Demonstrates creating an observable from an array, applying map and filter operators, and subscribing to log values. Also shows converting a Promise to an Observable.

const Rx = require('rx-lite'); const source = Rx.Observable.fromArray([1, 2, 3, 4, 5]); const subscription = source .map(x => x * 2) .filter(x => x > 5) .subscribe( x => console.log('Next: ' + x), err => console.error('Error: ' + err), () => console.log('Completed') ); // Example with a promise const somePromise = Promise.resolve('Hello from Promise!'); Rx.Observable.fromPromise(somePromise) .subscribe( data => console.log('Promise data: ' + data), err => console.error('Promise error: ' + err) ); // To stop listening (important for long-lived observables) // subscription.dispose();
Debug
Known issues
breakingThis `rx-lite` package is for RxJS v4. Development transitioned to 'RxJS vNext' (modern `rxjs` v5+), which introduced significant breaking changes, API rewrites, and a new modular import system. `rx-lite` is not compatible with modern RxJS.
fix
Migrate to the current `rxjs` package (`npm install rxjs`). This involves rewriting import statements and potentially many operator calls due to API changes.
affects: >=4.0.0
gotchaRxJS v4, including `rx-lite`, primarily targets CommonJS for Node.js and global script tags for browsers. It does not support native ES Modules (ESM) `import` syntax, which will lead to errors.
fix
Use `require('rx-lite')` for Node.js environments. For browser usage, include `rx.lite.js` via a `<script>` tag, which exposes `Rx` globally.
affects: >=2.0.0
breakingIn versions prior to 4.0.6, `Rx.Observable.fromPromise(promise)` was known to swallow errors originating from Observable instances within the promise chain, leading to silent failures.
fix
Upgrade to `rx-lite` version 4.0.6 or newer. If upgrading is not possible, ensure robust error handling within your promises before converting them to Observables.
affects: <4.0.6
deprecatedThe package name `rx-lite` is an artifact of RxJS v4. Modern RxJS uses the package name `rxjs` and does not differentiate between 'lite' and 'core' versions in the same way, as it is tree-shakable by default.
fix
Use `npm install rxjs` for new projects or when migrating. Consult the official RxJS documentation for current best practices.
affects: >=4.0.0
Errors
Common errors & fixes
TypeError: (0, _rxLite.Observable) is not a constructor
Attempting to use ES module import syntax (`import { Observable } from 'rx-lite';`) with a CommonJS-only package.
fix
Use CommonJS `require`: `const Rx = require('rx-lite'); const Observable = Rx.Observable;`
ReferenceError: require is not defined
Using `require('rx-lite')` directly in a browser environment without a CommonJS bundler (like Webpack or Browserify).
fix
For browser usage, include the `rx.lite.js` file via a `<script>` tag. For bundled applications, ensure your bundler is correctly configured to handle CommonJS modules.
ReferenceError: Rx is not defined
Trying to use `Rx` in the browser without loading the `rx.lite.js` script, or in Node.js without `require('rx-lite')`.
fix
Ensure `rx.lite.js` is loaded via a `<script>` tag before your code, or add `const Rx = require('rx-lite');` at the top of your Node.js file.
Upgrade
Version history
4.0.8latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
rx-lite — npm install rx-lite · libregistry