Gathering detailed insights and metrics for typia
Gathering detailed insights and metrics for typia
Gathering detailed insights and metrics for typia
Gathering detailed insights and metrics for typia
Super-fast/easy runtime validators and serializers via transformation
npm install typia
Typescript
Module System
Node Version
NPM Version
94.8
Supply Chain
97
Quality
92
Maintenance
100
Vulnerability
98.6
License
TypeScript (95.43%)
MDX (4.41%)
JavaScript (0.13%)
HTML (0.03%)
Total Downloads
11,045,759
Last Day
68,144
Last Week
424,485
Last Month
1,712,856
Last Year
9,562,273
MIT License
5,187 Stars
2,278 Commits
183 Forks
16 Watchers
3 Branches
85 Contributors
Updated on Jun 14, 2025
Minified
Minified + Gzipped
Latest Version
9.3.1
Package Id
typia@9.3.1
Unpacked Size
5.19 MB
Size
817.96 kB
File Count
3,537
NPM Version
10.8.2
Node Version
20.19.1
Published on
May 20, 2025
Cumulative downloads
Total Downloads
Last Day
101.6%
68,144
Compared to previous day
Last Week
45.8%
424,485
Compared to previous week
Last Month
24.6%
1,712,856
Compared to previous month
Last Year
594%
9,562,273
Compared to previous year
7
2
20
1// RUNTIME VALIDATORS 2export function is<T>(input: unknown): input is T; // returns boolean 3export function assert<T>(input: unknown): T; // throws TypeGuardError 4export function assertGuard<T>(input: unknown): asserts input is T; 5export function validate<T>(input: unknown): IValidation<T>; // detailed 6 7// JSON FUNCTIONS 8export namespace json { 9 export function application<T>(): IJsonApplication; // JSON schema 10 export function assertParse<T>(input: string): T; // type safe parser 11 export function assertStringify<T>(input: T): string; // safe and faster 12} 13 14// AI FUNCTION CALLING SCHEMA 15export namespace llm { 16 // collection of function calling schemas 17 export function application<Class, Model>(): ILlmApplication<Class>; 18 export function controller<Class, Model>( 19 name: string, 20 execute: Class, 21 ): ILlmController<Model>; // +executor 22 // structured output 23 export function parameters<P, Model>(): ILlmSchema.IParameters<Model>; 24 export function schema<T, Model>(): ILlmSchema<Model>; // type schema 25} 26 27// PROTOCOL BUFFER 28export namespace protobuf { 29 export function message<T>(): string; // Protocol Buffer message 30 export function assertDecode<T>(buffer: Uint8Array): T; // safe decoder 31 export function assertEncode<T>(input: T): Uint8Array; // safe encoder 32} 33 34// RANDOM GENERATOR 35export function random<T>(g?: Partial<IRandomGenerator>): T;
typia
is a transformer library supporting below features:
[!NOTE]
- Only one line required, with pure TypeScript type
- Runtime validator is 20,000x faster than
class-validator
- JSON serialization is 200x faster than
class-transformer
If you call typia
function, it would be compiled like below.
This is the key concept of typia
, transforming TypeScript type to a runtime function. The typia.is<T>()
function is transformed to a dedicated type checker by analyzing the target type T
in the compilation level.
This feature enables developers to ensure type safety in their applications, leveraging TypeScript's static typing while also providing runtime validation. Instead of defining additional schemas, you can simply utilize the pure TypeScript type itself.
1//---- 2// examples/checkString.ts 3//---- 4import typia, { tags } from "typia"; 5export const checkString = typia.createIs<string>(); 6 7//---- 8// examples/checkUUID.js 9//---- 10import typia from "typia"; 11export const checkString = (() => { 12 return (input) => "string" === typeof input; 13})();
Thanks for your support.
Your donation encourages typia
development.
Also, typia
is re-distributing half of donations to core contributors of typia
.
You can experience how typia works by playground website:
Check out the document in the website:
dev.to
ArticlesNo vulnerabilities found.
No security vulnerabilities found.