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

@opentalon/talon-runtime

v0.1.0

Published

Reactive rule engine for Talon — path-based store with extensible actions

Downloads

106

Readme

@opentalon/talon-runtime

Reactive rule engine for Talon — a path-based reactive store that evaluates Talon rules on every state change and dispatches resulting actions to subscribers and registered handlers.

This is the JavaScript runtime, intended for browser and Node applications that want to embed Talon's reactive rule subset (the lexer, parser, evaluator, and TalonStore). For workflow execution, ML primitives, and the full CLI, see the Go implementation in the main repo.

Install

npm install @opentalon/talon-runtime

Quick start

import { TalonStore } from "@opentalon/talon-runtime"

const store = new TalonStore()

store.loadRules(`
  rule "Show delivery address" {
    when "product_type" != "digital"
    do show "delivery_address"
  }

  rule "Recalculate subtotal" {
    when "unit_price" changes or "quantity" changes
    do set "subtotal" to "unit_price" * "quantity"
  }
`)

store.subscribe("*", (actions) => {
  for (const a of actions) {
    console.log(a.rule, a.verb, a.args)
  }
})

store.set("product_type", "physical")
store.set("unit_price", 100)
store.set("quantity", 5)

console.log(store.get("subtotal")) // 500

Features

  • Path-based state — flat keys ("unit_price") or nested paths ("booking.items.0.qty").
  • Reactive evaluation — every set() re-evaluates affected rules.
  • Tagged rule setsloadRules(src, { tag }) / unloadRules(tag) for dynamic rule swapping.
  • Built-in actionsset and validate are handled internally; everything else is dispatched.
  • Custom action handlersstore.registerAction("show", (path) => …).
  • Prefix subscriptionsstore.subscribe("booking.*", …) only fires for matching actions.
  • define blocks — name a condition once, reuse it via when is "name".

API

const store = new TalonStore()

store.loadRules(source: string, opts?: { tag?: string }): void
store.unloadRules(tag: string): void

store.set(path: string, value: unknown): void
store.get(path: string): unknown

store.registerAction(verb: string, handler: (...args: any[]) => void): void
store.subscribe(prefix: string, cb: (actions: ActionResult[]) => void): Unsubscribe

Scope

The JS runtime implements the reactive subset of Talon — rules, define, conditions, and actions. Workflows, ML primitives, forecast/detect blocks, and .talon.test files are Go-only. See the main repo for the full language.

License

Apache-2.0