Stop being the product.
Become the owner.
or
sign uplog in

Type-safe offline VIN decoder with community-extensible…

Type-safe offline VIN decoder with community-extensible patterns

Shipped v2.0 of /corgi - a fully typed offline VIN decoder.

**What's new:** Community pattern contributions via validated YAML.

**The stack:**

* Zod schemas for YAML validation
* SQLite database (better-sqlite3 / sql.js / D1)
* Full TypeScript types for decode results
* Pattern matching engine with confidence scoring

**Types:**

interface DecodeResult {
vin: string
valid: boolean
components: {
vehicle?: {
make: string
model: string
year: number
bodyStyle?: string
driveType?: string
fuelType?: string
}
wmi?: { manufacturer: string; country: string }
plant?: { country: string; city?: string }
engine?: { cylinders?: string; displacement?: string }
}
errors: DecodeError]
patterns?: PatternMatch[]
}

**Usage:**

import { createDecoder } from '@cardog/corgi'

const decoder = await createDecoder()
const result = await decoder.decode('LRWYGCEK1PC550123')

// Fully typed
result.components.vehicle?.make // string | undefined
result.components.vehicle?.year // number | undefined

**Platform adapters:**

* Node: native SQLite
* Browser: sql.js with gzip fetch
* Cloudflare Workers: D1 adapter

**Links:**

* npm: [https://www.npmjs.com/package/@cardog/corgi https://www.npmjs.com/package/@cardog/corgi
* GitHub: https://github.com/cardog-ai/corgi

Feedback welcome. The pattern contribution system uses Zod for schema validation - curious if anyone has thoughts on the approach.
#technology #programming #js #dev
earnings
3,000 mlx total
$0  total
engagement
3 views
0 reactions

0 comments