npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

reactor-core-ts

v1.0.9-beta

Published

The Reactive-Streams based implementation of Reactor-Core

Readme

The reactor-core-ts library is a TypeScript-based implementation of reactive streams, inspired by reactor-core. It provides powerful tools for building reactive systems with backpressure support, designed for high-performance data processing and efficient flow control.

This library supports a wide range of reactive patterns, including:

  • Mono: A single-value or empty result.
  • Flux: A multi-value, stream-like result.
  • Sinks: Different types of data sinks with backpressure management.
  • Schedulers: Various schedulers for asynchronous task execution.

Installation

To install the package using npm:

npm install reactor-core-ts

To install the package using pnpm:

pnpm install reactor-core-ts

To install the package using yarn:

yarn install reactor-core-ts

Features

  • Reactive Streams with Backpressure: Seamless management of data flow and pressure.
  • Flexible Data Sinks: Supports single, multi, and replay sinks.
  • Customizable Schedulers: Immediate, Micro, Macro, and Delayed execution.
  • Reactive Extensions: Map, filter, merge, concat, reduce, and more.
  • TypeScript Support: Fully typed for safer and more maintainable code.

Usage

Basic Example: Using Mono and Flux

import {Mono, Flux, Sinks, Schedulers} from "@ckateptb/reactor-core-js";

// Creating a Mono
const mono = Mono.just(42);

// Creating a Flux
const flux = Flux.range(1, 5);

// Using Schedulers for task execution
const immediateScheduler = Schedulers.immediate();
const microScheduler = Schedulers.micro();
const macroScheduler = Schedulers.macro();
const delayScheduler = Schedulers.delay(1000); // 1-second delay

// Schedule a simple task immediately
immediateScheduler.schedule(() => console.log("Immediate task executed"));

// Schedule a microtask
microScheduler.schedule(() => console.log("Microtask executed"));

// Schedule a macrotask
macroScheduler.schedule(() => console.log("Macrotask executed"));

// Schedule a delayed task and cancel it before execution
const delayedTask = delayScheduler.schedule(() => console.log("Delayed task executed"));
delayedTask.cancel(); // Cancels the task before it runs

// Pipe a Publisher
flux
    .doFinally(() => console.log('finally'))       // Executes after the pipeline completes
    .map(value => value * 2)                      // Transforms each value by multiplying by 2
    .filter(value => value % 2 === 0)              // Filters even numbers
    .concatWith(Flux.range(5, 5))                  // Concatenates with another range
    .mergeWith(Flux.range(10, 5))                  // Merges with another range
    .delayElements(5000)                           // Delays each emitted element by 5 seconds
    .doFirst(() => console.log('first'))            // Executes before the first emission
    // ... for more pipes, see the JSDoc
    // Subscribe to the publisher
    .subscribe({
        onNext: (value) => {
            console.log(value);
        },
        onError: (error) => {
            console.error(error);
        },
        onComplete: () => {
            console.log('complete');
        }
    })
    // Do not forget to request
    .request(Number.MAX_SAFE_INTEGER);

// Sinks
const sink = Sinks.many().multicast<number>();
let count = 0;

setInterval(() => {
    sink.next(count++); // Emit incrementing values every interval
}, 1000);

Flux.from(sink)
    .subscribe({
        onNext: (value) => console.log("Sink value:", value),
        onError: (error) => console.error("Sink error:", error),
        onComplete: () => console.log("Sink complete")
    })
    .request(5); // Request 5 values from the sink

Contributing

1. Clone the repository:

git clone https://github.com/CKATEPTb/reactor-core-ts.git

2. Install dependencies::

pnpm install

3. Run the build::

pnpm run build

License

This project is licensed under the LGPL-3.0-only License.

See the LICENSE.md file for details.

Author

CKATEPTb

Feel free to open issues and submit pull requests to improve the library!