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

@epikodelabs/streamix

v3.0.1

Published

Pull-based reactive streams with async iterators

Readme


✨ What is streamix?

streamix is a lightweight reactive runtime for TypeScript and JavaScript, built around async iterators and pull-based execution.

Most reactive libraries push values at you whether you asked for them or not. streamix turns that around: values are computed when you request them, state reads are synchronous, and every subscription has a clear lifecycle. The result feels closer to ordinary async/await than to a stream framework — while keeping the composability of one.

That makes it a good fit for dashboards, interactive applications, and concurrency-heavy browser work: places where you want reactive state, explicit lifecycles, and a mental model you can hold in your head.

Highlights

  • ⚛️ Atoms and scopes — reactive state with dependency tracking and real disposal boundaries
  • 🔄 Pull-based flows — work happens only when downstream consumers ask for values
  • 🔁 Transactions — group several writes into a single reactive update
  • 🧩 Familiar operatorsmap, filter, switchMap, debounce, scan, and 40+ more
  • ⏱️ Async-iterator first — everything plays naturally with for await...of
  • 📦 Small footprint — one package, tree-shakeable, sideEffects: false

📦 Installation

npm install @epikodelabs/streamix
# or
yarn add @epikodelabs/streamix
# or
pnpm add @epikodelabs/streamix

🧠 Core Concepts

⚛️ Atoms: state that reads like a variable

An atom is a reactive value. Read it synchronously, write to it, subscribe to it, or consume it as an async iterable — whichever fits the code you're writing.

  • atom(initial) creates a writable value you can read right away
  • atom<T>() creates one whose value arrives later
  • derived() creates a computed value that recalculates when its dependencies change
  • flow() wraps async work — with cancellation and cleanup built in

derived() is synchronous by design. If a computation needs await, cancellation, or restart behavior, that's a job for flow().

🧭 Scopes: state with a lifecycle

A scope groups related atoms behind plain properties and disposes of everything when you're done. Reading and writing feel like ordinary object access — the reactivity is underneath.

import { scope } from '@epikodelabs/streamix';

const app = scope<{
  count: number;
  events: string;
  doubled: number;
}>({
  count: 0,
  events: '',
  doubled: (self) => self.count * 2,
});

app.count = 5;
app.events = 'hello';

console.log(app.doubled); // 10

app.dispose();

🔄 Flows: sequences through familiar operators

Flows model sequences of values over time — events, timers, requests, generators. Compose them with the operator API you already know:

import { pipe, take } from '@epikodelabs/streamix';

async function* countdown() {
  for (let i = 10; i > 0; i--) {
    yield `T-${i}...`;
    await new Promise(r => setTimeout(r, 500));
  }

  yield '🚀 Launch!';
}

const launchSequence = pipe(countdown(), take(11));

for await (const msg of launchSequence) {
  console.log(msg);
}

Because flows are pull-based, nothing runs until you iterate — an infinite generator piped through take(5) computes exactly five values.

🔁 Subscribing and iterating

Atoms are async iterables. Use iterate() to consume one as a stream of updates:

import { atom, iterate } from '@epikodelabs/streamix';

const a = atom(0);

for await (const value of iterate(a)) {
  console.log(value);
}

When several writes should land as one update, wrap them in transaction() — subscribers and derived values see a single consistent change.


📚 Entry Points

Everything ships from one package. A few focused add-ons live alongside the core:

| Entry point | What you get | | ----------- | ------------ | | @epikodelabs/streamix | Atoms, scopes, flows, operators | | @epikodelabs/streamix/aggregates | average, min/max, sum, and friends | | @epikodelabs/streamix/dom | DOM observers — on('animationFrame'), mediaQuery, intersection, … | | @epikodelabs/streamix/networking | HTTP client, WebSocket, JSONP |


🌍 Ecosystem

Some capabilities live in sibling packages, all compatible with streamix v3:

| Package | Purpose | |---------|---------| | @epikodelabs/coroutines | Workers, structured task ownership, channels, actors | | @epikodelabs/waypoint | Server-authorized routing for Angular | | @epikodelabs/forms | Reactive form engine for TypeScript |


📖 Documentation


💬 Community

We'd love to hear what you build.


📜 License

GNU AGPL v3 or later