[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-71390":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":15,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":24,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":44,"readmeContent":45,"aiSummary":46,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":47,"discoverSource":48},71390,"typia","samchon\u002Ftypia","samchon","Super-fast\u002Feasy runtime validators and serializers via transformation","https:\u002F\u002Ftypia.io\u002F",null,"TypeScript",5823,224,17,11,0,2,42,6,38.06,"MIT License",false,"master",true,[26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"agentic-ai","ajv","checker","fast","generator","hacktoberfest","json","json-schema","llm-function-calling","openapi","protobuf","random","runtime","stringify","transform","type","typescript","validator","2026-06-12 02:02:51","# Typia\n\n![Typia Logo](https:\u002F\u002Ftypia.io\u002Flogo.png)\n\n[![GitHub license](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-blue.svg)](https:\u002F\u002Fgithub.com\u002Fsamchon\u002Ftypia\u002Fblob\u002Fmaster\u002FLICENSE)\n[![NPM Version](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Ftypia.svg)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Ftypia)\n[![NPM Downloads](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fdm\u002Ftypia.svg)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Ftypia)\n[![Build Status](https:\u002F\u002Fgithub.com\u002Fsamchon\u002Ftypia\u002Fworkflows\u002Ftest\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fsamchon\u002Ftypia\u002Factions?query=workflow%3Atest)\n[![Guide Documents](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FGuide-Documents-forestgreen)](https:\u002F\u002Ftypia.io\u002Fdocs\u002F)\n[![Discord Badge](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdiscord-samchon-d91965?style=flat&labelColor=5866f2&logo=discord&logoColor=white&link=https:\u002F\u002Fdiscord.gg\u002FE94XhzrUCZ)](https:\u002F\u002Fdiscord.gg\u002FE94XhzrUCZ)\n\n```typescript\n\u002F\u002F RUNTIME VALIDATORS\nexport function is\u003CT>(input: unknown): input is T; \u002F\u002F returns boolean\nexport function assert\u003CT>(input: unknown): T; \u002F\u002F throws TypeGuardError\nexport function assertGuard\u003CT>(input: unknown): asserts input is T;\nexport function validate\u003CT>(input: unknown): IValidation\u003CT>; \u002F\u002F detailed\n\n\u002F\u002F JSON FUNCTIONS\nexport namespace json {\n  export function schema\u003CT>(): IJsonSchemaUnit\u003CT>; \u002F\u002F JSON schema\n  export function assertParse\u003CT>(input: string): T; \u002F\u002F type safe parser\n  export function assertStringify\u003CT>(input: T): string; \u002F\u002F safe and faster\n}\n\n\u002F\u002F AI FUNCTION CALLING HARNESS\nexport namespace llm {\n  \u002F\u002F collection of function calling schemas + validators\u002Fparsers\n  export function application\u003CClass>(): ILlmApplication\u003CClass>;\n  export function structuredOutput\u003CP>(): ILlmStructuredOutput;\n  \u002F\u002F lenient json parser + type coercion\n  export function parse\u003CT>(str: string): T;\n}\n\n\u002F\u002F PROTOCOL BUFFER\nexport namespace protobuf {\n  export function message\u003CT>(): string; \u002F\u002F Protocol Buffer message\n  export function assertDecode\u003CT>(buffer: Uint8Array): T; \u002F\u002F safe decoder\n  export function assertEncode\u003CT>(input: T): Uint8Array; \u002F\u002F safe encoder\n}\n\n\u002F\u002F RANDOM GENERATOR\nexport function random\u003CT>(g?: Partial\u003CIRandomGenerator>): T;\n```\n\n`typia` is a transformer library supporting below features:\n\n  - Super-fast Runtime Validators\n  - Enhanced JSON schema and serde functions\n  - LLM function calling harness\n  - Protocol Buffer encoder and decoder\n  - Random data generator\n\n> [!NOTE]\n>\n> - **Only one line** required, with pure TypeScript type\n> - Runtime validator is **20,000x faster** than `class-validator`\n> - JSON serialization is **200x faster** than `class-transformer`\n> - LLM function calling harness turns **6.75% → 100%** accuracy\n\n\u003C!--\n## Setup\n\nInstall `typia@next` with the [`ttsc`](https:\u002F\u002Fgithub.com\u002Fsamchon\u002Fttsc) toolchain.\n\n```bash\n# install\nnpm i typia@next\nnpm i -D ttsc @typescript\u002Fnative-preview\n\n# build\nnpx ttsc\n\n# run a script directly\nnpx ttsx src\u002Findex.ts\n```\n\nYou **must** use `ttsc` and `ttsx`. The stock `tsc`, `ts-node`, and `tsx` cannot apply the `typia` transform, so they will not work.\n\nFor bundler integration (Vite, Next.js, Webpack, Rollup, esbuild, ...), use [`@ttsc\u002Funplugin`](https:\u002F\u002Fgithub.com\u002Fsamchon\u002Fttsc\u002Ftree\u002Fmaster\u002Fpackages\u002Funplugin).\n-->\n\n## Transformation\n\nIf you call `typia` function, it would be compiled like below.\n\nThis is the key concept of `typia`, transforming TypeScript type to a runtime function. The `typia.is\u003CT>()` function is transformed to a dedicated type checker by analyzing the target type `T` in the compilation level.\n\nThis 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.\n\n```typescript\n\u002F\u002F----\n\u002F\u002F examples\u002FcheckString.ts\n\u002F\u002F----\nimport typia, { tags } from \"typia\";\nexport const checkString = typia.createIs\u003Cstring>();\n\n\u002F\u002F----\n\u002F\u002F examples\u002FcheckString.js\n\u002F\u002F----\nimport typia from \"typia\";\nexport const checkString = (() => {\n  return (input) => \"string\" === typeof input;\n})();\n```\n\n## Sponsors\n\n[![Backers](https:\u002F\u002Fopencollective.com\u002Ftypia\u002Fbackers.svg?avatarHeight=75&width=600)](https:\u002F\u002Fopencollective.com\u002Ftypia)\n\nThanks for your support.\n\nYour [donation](https:\u002F\u002Fopencollective.com\u002Ftypia) encourages `typia` development.\n\n## Playground\n\nYou can experience how typia works by [playground website](https:\u002F\u002Ftypia.io\u002Fplayground):\n\n- 💻 https:\u002F\u002Ftypia.io\u002Fplayground\n\n## Guide Documents\n\nCheck out the document in the [website](https:\u002F\u002Ftypia.io\u002Fdocs\u002F):\n\n### 🏠 Home\n\n- [Introduction](https:\u002F\u002Ftypia.io\u002Fdocs\u002F)\n- [Setup](https:\u002F\u002Ftypia.io\u002Fdocs\u002Fsetup\u002F)\n  - [Legacy (TypeScript v6)](https:\u002F\u002Ftypia.io\u002Fdocs\u002Fsetup\u002Flegacy)\n  - [TSGO (TypeScript v7)](https:\u002F\u002Ftypia.io\u002Fdocs\u002Fsetup\u002Ftsgo)\n- [Pure TypeScript](https:\u002F\u002Ftypia.io\u002Fdocs\u002Fpure\u002F)\n  \n### 📖 Features\n\n- Runtime Validators\n  - [`assert()` function](https:\u002F\u002Ftypia.io\u002Fdocs\u002Fvalidators\u002Fassert\u002F)\n  - [`is()` function](https:\u002F\u002Ftypia.io\u002Fdocs\u002Fvalidators\u002Fis\u002F)\n  - [`validate()` function](https:\u002F\u002Ftypia.io\u002Fdocs\u002Fvalidators\u002Fvalidate\u002F)\n  - [Functional Module](https:\u002F\u002Ftypia.io\u002Fdocs\u002Fvalidators\u002Ffunctional)\n  - [Special Tags](https:\u002F\u002Ftypia.io\u002Fdocs\u002Fvalidators\u002Ftags\u002F)\n- Enhanced JSON\n  - [JSON Schema](https:\u002F\u002Ftypia.io\u002Fdocs\u002Fjson\u002Fschema\u002F)\n  - [`stringify()` functions](https:\u002F\u002Ftypia.io\u002Fdocs\u002Fjson\u002Fstringify\u002F)\n  - [`parse()` functions](https:\u002F\u002Ftypia.io\u002Fdocs\u002Fjson\u002Fparse\u002F)\n- LLM Function Calling Harness\n  - [`application()` function](https:\u002F\u002Ftypia.io\u002Fdocs\u002Fllm\u002Fapplication\u002F)\n  - [`structuredOutput()` function](https:\u002F\u002Ftypia.io\u002Fdocs\u002Fllm\u002FstructuredOutput\u002F)\n  - [`HttpLlm` module](https:\u002F\u002Ftypia.io\u002Fdocs\u002Fllm\u002Fhttp\u002F)\n  - [`LlmJson` module](https:\u002F\u002Ftypia.io\u002Fdocs\u002Fllm\u002Fjson\u002F)\n- Protocol Buffer\n  - [Message Schema](https:\u002F\u002Ftypia.io\u002Fdocs\u002Fprotobuf\u002Fmessage)\n  - [`decode()` functions](https:\u002F\u002Ftypia.io\u002Fdocs\u002Fprotobuf\u002Fdecode\u002F)\n  - [`encode()` functions](https:\u002F\u002Ftypia.io\u002Fdocs\u002Fprotobuf\u002Fencode\u002F)\n- [Random Generator](https:\u002F\u002Ftypia.io\u002Fdocs\u002Frandom\u002F)\n- [Miscellaneous](https:\u002F\u002Ftypia.io\u002Fdocs\u002Fmisc\u002F)\n\n### 🔗 Appendix\n\n- [API Documents](https:\u002F\u002Ftypia.io\u002Fapi)\n- Utilization Cases\n  - [MCP](https:\u002F\u002Ftypia.io\u002Fdocs\u002Futilization\u002Fmcp\u002F)\n  - [Vercel AI SDK](https:\u002F\u002Ftypia.io\u002Fdocs\u002Futilization\u002Fvercel\u002F)\n  - [LangChain](https:\u002F\u002Ftypia.io\u002Fdocs\u002Futilization\u002Flangchain\u002F)\n  - [NestJS](https:\u002F\u002Ftypia.io\u002Fdocs\u002Futilization\u002Fnestjs\u002F)\n  - [tRPC](https:\u002F\u002Ftypia.io\u002Fdocs\u002Futilization\u002Ftrpc\u002F)\n- [⇲ Benchmark Result](https:\u002F\u002Fgithub.com\u002Fsamchon\u002Ftypia\u002Ftree\u002Fmaster\u002Fbenchmark\u002Fresults\u002F11th%20Gen%20Intel(R)%20Core(TM)%20i5-1135G7%20%40%202.40GHz)\n- [⇲ `dev.to` Articles](https:\u002F\u002Fdev.to\u002Fsamchon\u002Fseries\u002F22474)\n\n## Inspired By\n\n- [`typescript-is`](https:\u002F\u002Fgithub.com\u002Fwoutervh-\u002Ftypescript-is)\n","Typia 是一个用于快速运行时验证和序列化的 TypeScript 库。它通过转换技术提供了超快的运行时验证器、增强的 JSON 模式和序列化功能、LLM 函数调用支持、Protocol Buffer 编解码器以及随机数据生成器。其核心优势在于极高的性能，如运行时验证速度比 class-validator 快 20,000 倍，JSON 序列化速度比 class-transformer 快 200 倍。此外，Typia 还显著提高了 LLM 函数调用的准确性。该库适用于需要高性能类型安全处理的各种场景，包括 API 开发、数据验证及序列化等。","2026-06-11 03:37:28","high_star"]