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

@pylonts/runtime

v1.1.2

Published

Flow runtime layer — local direct-invocation runtime (scan controllers → DirectRouter); HTTP runtime planned

Readme

@pylonts/runtime

Runtime layer for @pylonts/flow — provides the deps consumed by flow api steps. Flow steps stay environment-agnostic: they call deps.getModule(name).getController(Cls).method(body) and swap the runtime (local / http) without changing flow code.

Local runtime (implemented)

In-process direct invocation — scans project controllers, builds a DirectRouter (inline controller calls, no HTTP server), and exposes per-module ModuleHandlers.

import { runLocalFlow } from '@pylonts/runtime';

const flow = await runLocalFlow({
  flowsDir: 'flow/flows',
  cwd: 'api-admin',
  names: ['adminAddBd', 'bdLogin', 'registerMerchant'],
});

Or compose manually with createLocalRuntime + @pylonts/flow's scanFlows/runSteps when finer control is needed:

import { createLocalRuntime } from '@pylonts/runtime';
import { scanFlows, runSteps } from '@pylonts/flow';

const runtime = await createLocalRuntime({ cwd: 'api-admin' });

const index = scanFlows('flow/flows');
const flow = await runSteps({
  index,
  driver: 'api',
  deps: runtime,                       // { getModule(name) }
  names: ['adminAddBd', 'bdLogin', 'registerMerchant'],
});
  • Controller scan + route registration: @pylonts/core scanFromDirectory / createDirectRouter (reused, not reimplemented)
  • Project config scan: <cwd>/src/config.ts's dbConfig export is picked up automatically → createDaoKnex initializes the global DAO (or pass dbConfig explicitly)
  • Auth: module.ctx.token — the facade injects it into every handler call
  • Instance: default new controllerClass() (module-level singleton services work out of the box)
  • bootstrap hook: project-specific environment singletons that live in framework modules (e.g. @pylonts/token-redis-driver's initTokenRedis) — the local runtime stays framework-agnostic and lets the project init them

Planned

  • HTTP runtime — real API calls (HMAC 签名 + token 会话, reusing @pylonts/api-client signing/session lifecycle)

API

  • runLocalFlow({ flowsDir, names, cwd?, bootstrap? }) — recommended entry: scan → runtime → runSteps
  • createLocalRuntime({ cwd?, pattern?, resolveModuleConfig?, dbConfig?, configFile?, bootstrap? }) → { router, modules, getModule(name) }
  • ApiDeps — Pick<LocalRuntime, 'getModule'>, the deps type flow api steps import
  • ModuleHandler / ControllerProxy / HandlerNotFoundError — module ctx + typed lazy controller access (from ts-flow, now shared)