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

@vite-hub/workflow

v0.0.3

Published

Workflow primitives and Vite integration for ViteHub.

Readme

@vite-hub/workflow

@vite-hub/workflow defines long-running work once and starts it through one runWorkflow() API.

Vercel definitions can register a native entry for durable execution. Definitions without one remain source-compatible, but execute inline and do not survive a function restart.

Install

pnpm add @vite-hub/workflow

Add the provider dependency for the workflow provider you configure. OpenWorkflow worker lifecycle helpers live at @vite-hub/workflow/runtime/openworkflow-worker, so importing the provider-agnostic package root does not require OpenWorkflow's types.

Minimal API

// server/workflows/welcome.ts
import { defineWorkflow } from "@vite-hub/workflow"

export default defineWorkflow<{ email: string }>(async ({ id, payload, step }) => {
  const email = await step?.do?.("send-email", {}, async () => {
    return { sentTo: payload.email }
  })

  return { id, email }
})

For a durable Vercel run, keep the same context-shaped interface and register a native entry containing the Workflow DevKit directive:

import { defineWorkflow, type WorkflowExecutionContext } from "@vite-hub/workflow"

interface WelcomePayload {
  email: string
}

async function durableWelcome({ payload }: WorkflowExecutionContext<WelcomePayload>) {
  "use workflow"

  return { sentTo: payload.email }
}

async function inlineWelcome({ payload }: WorkflowExecutionContext<WelcomePayload>) {
  return { sentTo: payload.email }
}

export default defineWorkflow(inlineWelcome, { native: durableWelcome })

ViteHub transforms the native entry with Workflow DevKit when it generates Vercel provider output.

// server/api/welcome.post.ts
import { getWorkflowRun, runWorkflow } from "@vite-hub/workflow"
import { defineEventHandler, readBody } from "h3"

export default defineEventHandler(async (event) => {
  const run = await runWorkflow("welcome", await readBody<{ email: string }>(event))
  return getWorkflowRun("welcome", run.id)
})

getWorkflowRun() normalizes provider run and step state, including timestamps, attempts, and failures. cancelWorkflow() cancels a durable run, and resumeWorkflowSignal() forwards an opaque signal token created inside the native workflow. Providers that cannot perform an operation fail explicitly instead of simulating it.

Throw ViteHubError when app callers need a stable, inspectable Workflow failure instead of parsing log output or provider-specific messages. ViteHub-owned failures use the package's fixed WorkflowErrorCode vocabulary.

import { ViteHubError } from "@vite-hub/runtime"

async function transcribe(recordingId: string) {
  try {
    return await transcribeRecording(recordingId)
  }
  catch (cause) {
    throw new ViteHubError("TRANSCRIPTION_FAILED", "Transcription failed.", {
      cause,
      details: { recordingId },
    })
  }
}

code and message remain available through error.toJSON(). Keep details JSON-safe and free of secrets; toJSON() omits cause, which remains available only on the in-memory error. ViteHub's built-in codes are typed as WorkflowErrorCode and use code-derived messages and code-specific details. Workflow Step retry behavior belongs in the Step's retry options rather than the error.

// vite.config.ts
import { hubWorkflow } from "@vite-hub/workflow/vite"
import { defineConfig } from "vite"

export default defineConfig({
  plugins: [hubWorkflow()],
  workflow: { provider: "openworkflow" },
})

Vite Integration

Use hubWorkflow() in Vite to discover server/workflows/<name>.ts, folder workflows such as server/workflows/welcome/index.ts with numbered step files, and src/<name>.workflow.ts.

Providers map to OpenWorkflow, Cloudflare Workflows, or Vercel Workflow.

Learn more at vitehub.dev.