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

typekro

v0.10.1

Published

A control plane aware framework for orchestrating kubernetes resources like a programmer.

Readme

TypeKro

Write TypeScript. Deploy Kubernetes. Runtime intelligence included.

NPM Version License GitHub stars Build Status

📚 Documentation • 💬 Discord • 🚀 Getting Started


What is TypeKro?

TypeKro is a TypeScript-first framework for orchestrating Kubernetes resources with type safety and runtime intelligence. Write infrastructure in pure TypeScript with full IDE support, then deploy directly to clusters or generate deterministic YAML for GitOps workflows.

Quick Start

bun add typekro arktype
import { type } from 'arktype';
import { kubernetesComposition } from 'typekro';
import { Deployment, Service } from 'typekro/simple';

// Define a reusable WebApp composition
const WebApp = kubernetesComposition({
  name: 'webapp',
  apiVersion: 'example.com/v1',
  kind: 'WebApp',
  spec: type({ name: 'string', image: 'string', replicas: 'number' }),
  status: type({ ready: 'boolean', endpoint: 'string' })
}, (spec) => {
  const deploy = Deployment({ id: 'app', name: spec.name, image: spec.image, replicas: spec.replicas });
  const svc = Service({ id: 'svc', name: `${spec.name}-svc`, selector: { app: spec.name }, ports: [{ port: 80 }] });

  return {
    ready: deploy.status.readyReplicas > 0,     // ✨ JavaScript → CEL
    endpoint: `http://${svc.status.clusterIP}`  // ✨ Template → CEL
  };
});

// Deploy multiple instances with a simple loop
const apps = [
  { name: 'frontend', image: 'nginx', replicas: 3 },
  { name: 'api', image: 'node:20', replicas: 2 }
];

const factory = WebApp.factory('direct', { namespace: 'production' });
for (const app of apps) await factory.deploy(app);

What this demonstrates:

  • Reusable compositions - Define once, deploy many times
  • Type-safe schemas - ArkType validates at compile-time and runtime
  • Cross-resource references - svc.status.clusterIP references live cluster state
  • JavaScript-to-CEL - Status expressions become runtime CEL
  • Native loops - Just for...of to deploy multiple apps

Why TypeKro?

| Feature | TypeKro | Pulumi | CDK8s | Helm | |---------|---------|--------|-------|------| | Type Safety | ✅ Full TypeScript | ✅ Multi-lang | ✅ TypeScript | ❌ Templates | | GitOps Ready | ✅ Deterministic YAML | ❌ State backend | ✅ YAML output | ✅ Charts | | Runtime Refs | ✅ CEL expressions | ❌ Deploy-time | ❌ Static | ❌ Templates | | Learning Curve | 🟢 Just TypeScript | 🔴 New concepts | 🟡 TS + K8s | 🔴 Templates | | Stateless | ✅ | ❌ State backend | ✅ | ✅ | | Cross-Resource | ✅ Runtime resolution | ❌ Deploy-time | ❌ Manual | ❌ Manual |

Deployment Modes

TypeKro supports multiple deployment strategies from the same code:

// 1. Direct deployment - immediate, no Kro required
const factory = graph.factory('direct', { namespace: 'dev' });
await factory.deploy(spec);

// 2. Kro deployment - runtime CEL evaluation
const kroFactory = graph.factory('kro', { namespace: 'prod' });
await kroFactory.deploy(spec);

// 3. YAML generation - GitOps workflows
const yaml = kroFactory.toYaml();
writeFileSync('k8s/app.yaml', yaml);

Core Features

Type-Safe Schemas with ArkType

const AppSpec = type({
  name: 'string',
  image: 'string',
  replicas: 'number',
  'environment?': '"dev" | "staging" | "prod"'
});

Cross-Resource References

const db = Deployment({ id: 'database', name: 'postgres', image: 'postgres:15' });
const api = Deployment({
  id: 'api',
  name: 'api-server',
  image: 'node:20',
  env: {
    DB_HOST: db.metadata.name  // Runtime reference
  }
});

JavaScript-to-CEL Conversion

Write natural JavaScript - TypeKro converts to CEL:

return {
  ready: deploy.status.readyReplicas > 0,           // → ${app.status.readyReplicas > 0}
  url: `http://${svc.status.clusterIP}`,            // → http://${svc.status.clusterIP}
  phase: deploy.status.phase === 'Running' ? 'up' : 'down'
};

Helm Integration

import { helmRelease, helmRepository } from 'typekro';

const repo = helmRepository({
  name: 'bitnami',
  url: 'https://charts.bitnami.com/bitnami'
});

const release = helmRelease({
  name: 'nginx',
  repository: repo,
  chart: 'nginx',
  values: {
    replicaCount: spec.replicas  // Type-safe values
  }
});

YAML File Integration

import { yamlFile } from 'typekro';

const existing = yamlFile({
  path: './k8s/existing-deployment.yaml',
  namespace: 'default'
});

Factory Functions

TypeKro provides 50+ factory functions for Kubernetes resources:

Workloads: Deployment, StatefulSet, DaemonSet, Job, CronJob

Networking: Service, Ingress, NetworkPolicy

Config: ConfigMap, Secret

Storage: PersistentVolumeClaim, PersistentVolume, StorageClass

RBAC: ServiceAccount, Role, RoleBinding, ClusterRole, ClusterRoleBinding

View Complete API Reference →

What is Kro?

Kubernetes Resource Orchestrator (Kro) is an open-source project by AWS Labs that enables resources to reference each other's runtime state using CEL expressions.

TypeKro works in Direct Mode (no Kro required) for simple deployments, or Kro Mode for advanced orchestration with runtime dependencies.

Documentation

Installation

# Using bun (recommended)
bun add typekro arktype

# Using npm
npm install typekro arktype

# Using yarn
yarn add typekro arktype

Requirements

  • Node.js 18+ or Bun
  • TypeScript 5.0+
  • Kubernetes cluster (for deployment)
  • Kro controller (optional, for runtime features)

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

# Clone the repository
git clone https://github.com/yehudacohen/typekro.git
cd typekro

# Install dependencies
bun install

# Run tests
bun run test

# Build
bun run build

License

Apache 2.0 - See LICENSE for details.


DocumentationDiscordGitHub