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

asterflow

v2.2.0

Published

The core framework - ties together adapters, routing, plugins and responses into one typed AsterFlow app.

Readme

AsterFlow

license-info stars-info last-commit

bundle-size

The core framework - ties together adapters, routing, plugins and responses into one typed AsterFlow app.

📦 Installation

bun install asterflow

✨ Features

  • new AsterFlow(options) - creates an app around a driver (an @asterflow/adapter instance, defaults to adapters.node)
  • .method(...) / .router(...) - define a single-verb route or a multi-verb route group directly on the app, backed by @asterflow/router's Method/Router
  • .controller(route) - registers an already-built Method or Router instance
  • .middleware({ basePath, controllers }) - registers a group of controllers under a shared path prefix
  • Route use middlewares run first - a route's middleware chain runs before schema validation, and any middleware can return a response to short-circuit the request before the body is even parsed
  • Schema validation - if the route has a schema, the parsed body is validated after middlewares pass and before the handler runs
  • Plugin system - .use(plugin, config) registers an @asterflow/plugin instance, applies its instance extensions, and wires up its beforeInitialize/afterInitialize/onRequest/onResponse hooks
  • Merged plugin context - every plugin's context is resolved once, when .listen() is called, and handed to every handler as context.plugins (not recomputed per request)
  • Trie-based route matching - routes are stored and matched with reminist, keyed by HTTP method
  • Full type inference - registering a route narrows the app's type so its path, params, schema and middleware context are known at every call site

❓ How to Use

Build routes with .method()/.router() and start the server with .listen(). This route validates its body with a middleware-provided context before running:

import { AsterFlow } from 'asterflow'
import { Middleware } from '@asterflow/router'
import { z } from 'zod'

const auth = new Middleware({
  name: 'auth',
  onRun({ request, response, next }) {
    if (!request.getHeaders().authorization) return response.unauthorized({ message: 'Missing token' })
    return next({ userId: 42 })
  }
})

const app = new AsterFlow() // defaults to the Node adapter

app.method('post', {
  path: '/users',
  use: [auth],
  schema: z.object({ name: z.string() }),
  handler({ schema, middleware, response }) {
    return response.created({ id: middleware.userId, name: schema.name })
  }
})

app.listen({ port: 3000 })

Plugins register onto the same instance with .use() and can add their own instance methods:

import { AsterFlow } from 'asterflow'
import { fsRoutingPlugin } from '@asterflow/fs'

const app = new AsterFlow()
  .use(fsRoutingPlugin, { routes: [] }) // routes: AnyRouter[]

app.listen({ port: 3000 })

🔗 Related Packages

  • @asterflow/adapter - supplies the driver (Bun, Node, Express, Fastify) that .listen() delegates to
  • @asterflow/router - Method/Router/Middleware classes that back .method(), .router() and .controller()
  • @asterflow/plugin - plugin instances and types consumed by .use()
  • @asterflow/response - AsterResponse is what every request handler works with and returns
  • @asterflow/request - supplies the Request type passed into every route and middleware handler

📄 License

This project is licensed under the MIT License.