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

ube-tsp

v0.0.4

Published

A monorepo containing TypeSpec tools: emitter and Ky HTTP client generator

Readme

ube-tsp

🚀 TypeScript emitter with namespace structure and Ky HTTP client generator for TypeSpec.

Transform your TypeSpec definitions into production-ready, type-safe HTTP clients with zero runtime overhead.

✨ Features

  • 🏗️ Namespace-Aware - Preserves your TypeSpec namespace hierarchy in generated TypeScript code
  • 🔒 Fully Type-Safe - Complete end-to-end type safety from API definition to client usage
  • ⚡ Zero Runtime Overhead - Generates lightweight clients with minimal bundle impact
  • 🎯 Modern & Fast - Built on Ky for modern fetch-based HTTP requests
  • 🛠️ Developer Experience - IntelliSense, auto-completion, and compile-time error checking
  • 📦 Production Ready - Used in production environments with robust error handling

Perfect for teams who want to maintain API contracts while building fast, reliable TypeScript applications.

Packages

Quick Start

1. Install the emitter

npm install @ube-tsp/ky-emitter

2. Configure TypeSpec

# tspconfig.yaml
emit:
  - "@ube-tsp/ky-emitter"

3. Compile your TypeSpec

tsp compile .

4. Use the generated client

npm install @ube-tsp/ky-client ky
import ky from "ky";
import { createClient } from "@ube-tsp/ky-client";
import { operationMap, type OperationMap } from "./generated/operation-map.js";

const kyInstance = ky.create({ prefixUrl: "https://api.example.com" });
const client = createClient<OperationMap>(kyInstance, operationMap);

// Use nested methods based on your TypeSpec namespaces
await client.PetStore.getPet({ params: { path: { petId: 123 } } });

🔧 More Usage

Custom Ky Configuration

Pass additional Ky options for advanced scenarios:

// Custom timeout and headers
const result = await client.PetStore.getPet(
  { params: { path: { petId: 123 } } },
  {
    timeout: 5000,
    headers: { Authorization: "Bearer token" },
    retry: { limit: 3 },
  },
);

// Global configuration
const kyInstance = ky.create({
  prefixUrl: "https://api.example.com",
  timeout: 10000,
  hooks: {
    beforeRequest: [
      (request) => {
        request.headers.set("User-Agent", "MyApp/1.0");
      },
    ],
  },
});

Nested Namespaces

// For deeply nested TypeSpec namespaces
await client.Store.Inventory.Products.getProduct({
  params: { path: { productId: "abc123" } },
});

await client.Admin.Users.Permissions.grantPermission({
  params: {
    path: { userId: 456, permissionId: 789 },
    body: { reason: "Promotion to manager" },
  },
});

How it works

The emitter generates:

  • Namespace-structured TypeScript types - Mirrors your TypeSpec namespace hierarchy
  • Runtime operation map - Contains HTTP method, path, and status code information
  • Type-safe client methods - Automatically creates nested client structure from flat operation keys

Output Structure

For a TypeSpec like:

@service({
  title: "Pet Store API",
})
namespace PetStore {
  @route("/pets/{petId}")
  op getPet(@path petId: int32): Pet | NotFoundError;
}

The emitter generates:

generated/
├── Spec.ts              # Namespace-structured types
├── operation-map.ts     # Runtime operation mapping
└── Spec/
    └── PetStore.ts      # PetStore namespace types

The operation map contains:

export const operationMap = {
  "PetStore.getPet": {
    path: "/pets/{petId}",
    method: "GET",
    statusCodes: [200, 404],
  },
};

The client transforms this into:

// Typed as: (params: { path: { petId: number } }) => Promise<ApiResponse>
client.PetStore.getPet({ params: { path: { petId: 123 } } });

Development

npm run build    # Build all packages
npm run test     # Test all packages
npm run lint     # Lint all packages
npm run format   # Format code

Credits

Based on typespec-zod implementation patterns. Built with AI assistance from Claude Code.

License

MIT