Skip to content

Leyman

Libraries in TypeScript, Go and Rust, the framework that builds and checks them, and demos tested against real services.

Leyman is a monorepo of TypeScript packages for Node.js. It also holds the shared configs and tooling they are built with, demos tested against real services, and the infrastructure that CI and every devcontainer run on.

Packages ​

Each package is published to npm on its own, and has a getting-started page, guides and a full reference here. All packages →

Demos ​

Worked examples of open-source projects and services used together. Each one is a small package that isn't published, fully tested against real services, with a page on what it does and why. All demos →

  • BLAKE3 through WASM

    BLAKE3 from Rust through WASM with SIMD, on Node.js and in browsers, blocking or in a worker, measured against the fastest JavaScript to find where WASM pays off.

  • BLAKE3 from Go through WASM

    The same Rust crate called from Go without cgo, built to bare WASM behind a C ABI, run by wazero, and measured against BLAKE3 in Go and native Rust to find where it pays off.

  • Read-through cache

    A read-through cache built from BentoCache and lease-cache on Valkey, with a memory tier kept in sync, stale-while-revalidate, one load per key across instances, and sharding over several nodes with weighted rendezvous hashing.

  • OpenAPI

    A small notes API built properly from the spec down to the database, with an OpenAPI 3.1 document written with Juniper, genever types for a typed client and a Hono server that validates every request and response, and Drizzle on Postgres with a database per test.

  • MCP server

    An MCP server that makes the notes API easy for AI agents to use, with tools shaped around tasks, OAuth with step-up scopes, and token exchange so it calls the API as the agent’s user.

  • Fetch middleware

    Middleware around fetch, in the shape of Go’s RoundTripper: each concern of sending a request (auth, retries, limits) is a plugin, with a bearer token renewed once for a burst of refusals, and Ky retrying only what’s safe to send again.

  • CLI for agents

    A CLI that makes the notes API easy for AI agents with a shell, with one short command per task and a login that starts from nothing but the API’s URL.

  • Local ingress

    A Vite dev server behind one machine-wide Caddy, so every worktree has its own https://<worktree>.<repo>.localhost, with a locally trusted certificate, hot reload through the proxy, and tunnels for phones.

Infrastructure ​

The real, deployed systems this repository runs on, and how they are built. All infrastructure →

  • Hosted Nx cache

    One Nx cache shared by CI and every devcontainer, on a Cloudflare Worker and R2. Anyone can read from it, and only CI on main can write to it, using GitHub OIDC. The Worker is deployed with wrangler, and OpenTofu manages its bucket and tokens.

Framework ​

The setup these packages are built on, written up as a framework that another repository can adopt a piece at a time. Start here →

For AI agents ​

llms.txt lists every package, demo and piece of infrastructure, with links to its pages, npm and source. A package's README and types also ship with it on npm.