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

@statorjs/stator

v2.1.0

Published

Server-canonical web framework: business logic in composable state machines, UI as a thin renderer binding machine outputs to DOM positions. Ships TypeScript source (Vite/tsx-native by design).

Downloads

2,651

Readme

@statorjs/stator

A server-canonical web framework: business logic lives in composable state machines that have no awareness of the UI, and the UI is a thin renderer binding machine outputs to DOM positions. Templates are .stator single-file components; interactions POST typed events; the server diffs affected bindings into small JSON patches. Client islands run the same machine engine in the browser as custom elements.

Full documentation — tutorial, concepts, guides — lives in the repo's apps/docs site; the repo README has the tour.

Install

pnpm add @statorjs/stator hono

This package ships TypeScript source, by design. Stator is Vite/tsx-native: the dev server compiles .stator (and the framework's own .ts) through Vite, and production runs the built output under tsx. There is no dist/ of transpiled JS — a plain-Node consumer that can't load .ts modules can't import this package directly. This is a deliberate 1.0 stance, not an oversight.

Entry points

| import | contents | |---|---| | @statorjs/stator/server | createApp, defineMachine, defineRoute, defineApiRoute, stores, dispatchToApp | | @statorjs/stator/machine | the browser-safe engine core (defineMachine, createActor) | | @statorjs/stator/template | html, read, each, when/match, raw, directives | | @statorjs/stator/client | island runtime — StatorElement, use, machine, bind, dispatch | | @statorjs/stator/dev | createDevApp — the Vite-embedded dev server | | @statorjs/stator/build | buildApp, loadProductionHead, syncTypes | | @statorjs/stator/components | built-ins (<JsonLd>) |

compiler and vite subpaths exist but are internal — their shape may change in minor releases.

Minimal app

// server.ts
import { dirname, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import { createDevApp } from '@statorjs/stator/dev'

const here = dirname(fileURLToPath(import.meta.url))
const app = await createDevApp({
  root: here,
  machinesDir: resolve(here, 'machines'),
  routesDir: resolve(here, 'routes'),
})
await app.listen(3000)
// machines/counter.ts
import { defineMachine } from '@statorjs/stator/server'

type Events = { type: 'INCREMENT' }

export default defineMachine({
  name: 'CounterMachine',
  lifecycle: 'session',
  events: {} as Events,
  context: { count: 0 },
  initial: 'idle',
  states: {
    idle: {
      on: {
        INCREMENT: (ctx) => {
          ctx.count += 1
        },
      },
    },
  },
  selectors: { label: (ctx) => `count is ${ctx.count}` },
})
// routes/index.stator  (`Stator` is provided by the compiler — no import)
---
import Counter from '../machines/counter.ts'

const [counter] = Stator.reads([Counter])
---
<html>
  <body>
    <p>{read(counter, (c) => c.label)}</p>
    <button on:click={() => counter.send({ type: 'INCREMENT' })}>+</button>
  </body>
</html>

Run with tsx server.ts. See the repo's examples/desksmith for the full wiring (type sync, production build, deploy).

License

MIT