Announcing ArkType 2.0

100x faster validation with DX that will blow your mind

As of today, arktype@2.0.0 is generally available and fully stable.

ArkType 2.0 brings types to runtime JS in a way that, until today, has been a pipedream.

Whether you're a first-time TypeScript dev trying to validate a form or a library author introspecting relationships, ArkType offers fundamentally better tools for navigating the perils of JavaScript.

Type-level feedback on keystroke- no plugins or build steps required.

Unparalleled DX

Type syntax you already know with safety and completions unlike anything you've ever seen

const  = type({
	name: "string",
	platform: "'android' | 'ios'",
	"version?": "number | s
  • number | string
  • number | symbol
"
})

Faster... everything

100x faster than Zod at runtime with editor performance that will remind you how autocomplete is supposed to feel

Object Validation, Node v22.2.0 (source)
ArkType (15 nanoseconds)
  Zod (1374 nanoseconds)

Clarity and Concision

Definitions are half as long, type errors are twice as readable, and hovers tell you just what really matters

// hover me
const  = type({
	name: "string",
	platform: "'android' | 'ios'",
	"versions?": "number | string)[]"
TypeScript: Unmatched ) before [] 
})

Better Errors

Deeply customizable messages with great defaults

const  = user({
	name: "Alan Turing",
	platform: "enigma",
	versions: [0, "1", 0n]
})

if ( instanceof type.errors) {
	// hover summary to see validation errors
	console.error(.)
}

Deep Introspectability

ArkType uses set theory to understand and expose the relationships between your types at runtime the way TypeScript does at compile time

.extends("object") // true
.extends("string") // false
// true (string is narrower than unknown)
.extends({
	name: "unknown"
})
// false (string is wider than "Alan")
.extends({
	name: "'Alan'"
})

Intrinsic Optimization

Every schema is internally normalized and reduced to its purest and fastest representation

// all unions are optimally discriminated
// even if multiple/nested paths are needed
const  = type({
	kind: "'admin'",
	"powers?": "string[]"
}).or({
	kind: "'superadmin'",
	"superpowers?": "string[]"
}).or({
	kind: "'pleb'"
})

What next?

ArkType doesn't require a special environment or build step to work- our intro will have you up and running in seconds.

We have big plans to ArkType 2.0 even further, but we're even more excited to see what you do with it!

Starting coding

Check out the project on GitHub

👋 Join our Discord to lurk or ask questions

  • Follow any of these accounts for updates:

  • Consider supporting my full-time work on ArkType...

    • via GitHub Sponsors
    • by convincing your team to let me optimize your types and fix editor lag (reach out directly to one of the accounts listed or david@arktype.io)

On this page