SkillAgentSearch skills...

Typedriver

High Performance Driver for Runtime Type System Integration

Install / Use

/learn @sinclairzx81/Typedriver
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<div align='center'> <h1>TypeDriver</h1> <p>A High Performance Driver for Runtime Type System Integration</p> <img src="typedriver.png" /> <br /> <br />

npm version Downloads License Test

</div>

Install

$ npm install typedriver

Usage

import compile from 'typedriver'

const Vector3 = compile(`{
  x: number,
  y: number,
  z: number
}`)

const position = Vector3.parse(value)            // const position: {
                                                 //   x: number,
                                                 //   y: number,
                                                 //   z: number
                                                 // } = ...

Also Compiles: TypeScript | JSON Schema | TypeBox | Effect | Zod | ArkType | Valibot | Arri | Sury ... and more

Overview

TypeDriver is a multi-library compiler and type-inference middleware designed to integrate JSON Schema and Standard Schema validation into framework I/O interfaces such as HTTP routes and RPC endpoints. It provides high-performance compiler support for a wide range of ecosystem libraries and offers first-class TypeScript and JSON Schema validation and type inference as standard.

License MIT

Contents

Example

TypeDriver provides a simple infrastructure to connect type inference and validation to framework interfaces.

Ref: TypeScript | JSON Schema | Standard Schema

// Next Generation Inference System Based on TypeScript DSL (TS7)

route('/', {
  body: `{
    x: number,
    y: number,
    z: number
  }`
}, (request) => {
  const { x, y, z } = request.body // type-safe!
})

The above interface design is achieved with the following TypeScript definitions

<details> <summary>Route Interface Definition (Expand)</summary>
import { type Static, compile } from 'typedriver'

export interface RouteOptions<Body extends unknown = unknown> {
  body: Body
}
export type RouteCallback<Path extends string, Options extends RouteOptions> = (
  (request: { url: Path, body: Static<Options['body']> }) => void
)
export function route<Path extends string, const Options extends RouteOptions, 
  Callback = RouteCallback<Path, Options>
>(path: Path, options: Options, callback: Callback) {
  const body_validator = compile(options['body'])
  // todo: ... implement route logic
}
</details>

Compile

TypeDriver consists of a single compile(...) function that accepts JSON Schema, Standard Schema or TypeScript definition and returns a Validator instance.

import compile from 'typedriver'

Ref: [TypeScript](https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAbzgYwuYAbApnAvnAMyjTgHIYBPMLAEymADcspSAoV1AOwGd4A1LMhjQAzHAC8KNGExYAFAAMErOHAAeALjicAriABGzFXApbdBo6oBeZvYaitcCgJSq37j56-ef7gPR+Ujz8gsJQ

Related Skills

View on GitHub
GitHub Stars103
CategoryDevelopment
Updated2d ago
Forks2

Languages

TypeScript

Security Score

85/100

Audited on Mar 23, 2026

No findings