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

@bship/sdk

v0.2.3

Published

Write BuildShip workflows as plain TypeScript, run them locally, and call them from servers and browsers.

Readme

@bship/sdk

Write BuildShip workflows as plain TypeScript. Run them locally with a live map, deploy them to a BuildShip project, and call them from your servers and browsers.

Get started

In your app's folder (Vite, Next.js or plain Node):

npx @bship/cli@latest setup

This installs @bship/sdk and @bship/cli, adds an example workflow in flows/hello.ts, the dev and deploy scripts, the project variable in .env.local, and a skill that briefs coding agents on all of this. Your framework's config files stay untouched.

The skill alone, for any agent skills supports:

npx skills add https://cdn.jsdelivr.net/npm/@bship/sdk/skill/SKILL.md

Write a workflow

Workflows live in flows/. Mark each step once, where it's defined. Call sites stay plain function calls, with ordinary if, loops and try. Split a long workflow into groups.

// flows/refund.ts
import { workflow, step, group, sleep } from "@bship/sdk";

const loadOrder = step("loadOrder", async (id: string) => db.orders.find(id));
const issueRefund = step("issueRefund", async (order: Order) => stripe.refunds.create(…), {
  retries: 2,      // 1s, then 2s apart
  timeout: "10s",
});

const notifyAll = group("notifyAll", async (order: Order) => {
  await Promise.all([emailCustomer(order), notifyTeam(order)]);
});

export const processRefund = workflow("processRefund", async (input: { orderId: string }) => {
  const order = await loadOrder(input.orderId);
  if (!order.paid) {
    await step("log unpaid", async () => console.warn("unpaid", order.id));   // a one-off step, in place
    return { refunded: false };
  }
  await issueRefund(order);
  await notifyAll(order);
  await sleep("1d");
  return { refunded: true };
});

processRefund.trigger("api", "/refunds"); // only workflows with an "api" trigger are callable over HTTP

Run it

npm run dev                                          # your app, plus workflows on http://localhost:3939
npx buildship run processRefund '{"orderId":"o1"}'   # one workflow: each step, then the path it took

npm run dev runs buildship dev -- <your dev command>. Edits to flows/ apply on the next call.

Call it

From a browser, call it by name through @bship/sdk/client, which has no Node imports. The type-only import is erased at build, so no workflow code reaches the browser:

import { callWorkflow } from "@bship/sdk/client";
import type { greetUser } from "../flows/greet";

const { message } = await callWorkflow<typeof greetUser>("greetUser", { name: "Ada" });

From server code, call the handle:

import { callWorkflow } from "@bship/sdk";
import { greetUser } from "./flows/greet";

const { message } = await callWorkflow(greetUser, { name: "Ada" });

In npm run dev both run against your machine, so an edit shows on the next call and console.log prints in your terminal: the browser calls buildship dev, and server code runs the workflow in-process. That holds even with a project set.

Deploy it

Set your project in .env.local, under the name your framework hands to the browser:

| App | Variable | | -------- | ----------------------------------------------- | | Vite | VITE_BUILDSHIP_PROJECT=buildship-123abc | | Next.js | NEXT_PUBLIC_BUILDSHIP_PROJECT=buildship-123abc | | Anything | BUILDSHIP_PROJECT=buildship-123abc |

npm run deploy

Workflows then run at https://123abc.buildship.run/v1/function/<name>/run, and every callWorkflow in your production build, browser or server, goes there. npm run dev keeps running your local workflows; npm run dev:remote runs your app against the deployed ones.

API

| Export | What it does | | -------------------------- | -------------------------------------------------------------------------------- | | step(name, impl, opts?) | A step. impl may be sync or async; calling the step always returns a Promise. opts: retries (1s, 2s, 4s… apart) and timeout ("30s"). A step with no arguments runs when awaited, so await step("x", async () => …) defines and runs one in place. | | group(name, impl) | A named part of a workflow that calls steps. The map draws it as a box holding its steps. | | workflow(name, fn) | A workflow: a plain async (input) => output. Calling the handle runs it. | | .trigger(type, value) | "api" + route, or "cron" + schedule. Chainable. | | sleep(duration) | "500ms", "30s", "5m", "2h", "1d". | | callWorkflow(wf, input) | Runs another workflow: in-process, or on the project's runtime once one is set. | | onEvent(fn) | Every run event as it happens: started, completed and failed, for workflows, groups and steps. | | onRun(flows, fn) | Every finished run, replayed on its map: the node each call ran at and the edges it took. | | isDeployed() | true inside workflows running on BuildShip, false locally. Works at file load too. |

@bship/sdk/client exports callWorkflow(name, input), fetchGraph() and fetchRuns() (the map and the latest runs buildship dev serves), currentProject() and projectUrls(project). In app code, currentProject() tells you where calls go: undefined under npm run dev, the project id in a production build.

The map is read from the workflow body, so the body sticks to shapes it can draw: await every step (and only steps: wrap other async work in one), branch with if/switch, loop with for/while, and run steps in parallel with await Promise.all([...]). npx buildship graph names the line and the fix for anything else.