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

@frayme/api

v0.1.2

Published

Frayme API client — zero-dependency, fetch-based, streaming generative-UI compose for Node, edge, Bun, Deno, and Workers.

Readme

@frayme/api

The official TypeScript client for the Frayme generative-UI API. Zero dependencies, fetch-based — runs on Node ≥ 20.19, Bun, Deno, Cloudflare Workers, and Vercel Edge.

npm i @frayme/api
import Frayme from '@frayme/api';

const frayme = new Frayme({ apiKey: process.env.FRAYME_API_KEY });

const stream = frayme.compose.stream({ prompt: 'A pricing page with three tiers' });
stream.on('op', (op, snapshot) => render(snapshot)); // live spec snapshots
stream.on('restarted', () => clearRendered());       // attempt failed → discard & keep listening
const { spec, model } = await stream.finalSpec();    // validated final spec

Render spec with @frayme/runtime.

What you get

  • Two streaming layerscompose.stream() (handlers + async iteration + snapshot accumulation + finalSpec() + .abort()) or compose.create({ stream: true }) for a raw typed-event iterable. Non-streaming: compose.create({ stream: false }).
  • compose.restarted handled for you — Frayme validates every generation; when an attempt fails, the stream restarts with a stronger model in the same response. The SDK resets its snapshot and tells you to discard.
  • Retries that can't double-bill — 2 automatic retries (connection errors, 408/409/429/5xx) with jittered backoff and Retry-After support; one auto-generated Idempotency-Key per logical call is reused across attempts, so a retried success replays instead of re-billing.
  • Typed errorsRateLimitError (with .retryAfter), QuotaExceededError, PaymentRequiredError, CompositionFailedError, … all extending FraymeError with .status/.code/.requestId.
  • Browser-safe by design — constructing with a key in a browser throws. Use keyless proxy mode instead: new Frayme({ apiKey: null, baseURL: '/api/your-proxy' }).

Agent tool (all frameworks, one definition)

import { composeToolDefinition, createComposeTool } from '@frayme/api/tools';

// Vercel AI SDK 6:        tool({ ...createComposeTool(frayme) })
// Mastra:                 createTool({ ...createComposeTool(frayme) })
// OpenAI Agents SDK (JS): tool({ name, description, parameters: composeToolDefinition.inputSchema, execute })
// LangChain.js:           tool(execute, { schema: composeToolDefinition.inputSchema, ... })

The schema is Zod v4 (Standard Schema), so every major framework accepts it natively. Recipes: frayme.ai/examples.

API

frayme.compose.stream(req, opts?) · frayme.compose.create(req, opts?) · frayme.me() · frayme.health()

Full wire contract (for other languages): OpenAPI 3.1.

MIT © Orange Stack Ltd