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.9
Maintenance
100
Vulnerability
98.6
License
TypeScript (95.37%)
MDX (4.46%)
JavaScript (0.14%)
HTML (0.03%)
Total Downloads
9,155,901
Last Day
51,860
Last Week
353,990
Last Month
1,284,016
Last Year
7,835,732
MIT License
5,095 Stars
2,270 Commits
179 Forks
15 Watchers
3 Branches
84 Contributors
Updated on Apr 30, 2025
Latest Version
9.1.1
Package Id
typia@9.1.1
Unpacked Size
5.14 MB
Size
810.08 kB
File Count
3,523
NPM Version
10.8.2
Node Version
20.19.0
Published on
Apr 10, 2025
Cumulative downloads
Total Downloads
Last Day
4.3%
51,860
Compared to previous day
Last Week
2%
353,990
Compared to previous week
Last Month
-33.3%
1,284,016
Compared to previous month
Last Year
527.4%
7,835,732
Compared to previous year
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// LLM FUNCTION CALLING SCHEMA 15export namespace llm { 16 // application schema from a class or interface type 17 export function application<App, Model>(): ILlmApplication<Model>; 18 // structured output 19 export function parameters<P, Model>(): ILlmSchema.IParameters<Model>; 20 export function schema<T, Model>(): ILlmSchema<Model>; // type schema 21} 22 23// PROTOCOL BUFFER 24export namespace protobuf { 25 export function message<T>(): string; // Protocol Buffer message 26 export function assertDecode<T>(buffer: Uint8Array): T; // safe decoder 27 export function assertEncode<T>(input: T): Uint8Array; // safe encoder 28} 29 30// RANDOM GENERATOR 31export 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.