Socket
Book a DemoInstallSign in
Socket

typia

Package Overview
Dependencies
Maintainers
1
Versions
691
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typia

Runtime type checkers and 5x faster JSON.stringify() function

3.4.0-dev.20221212-2
Source
npmnpm
Version published
Weekly downloads
443K
-6.64%
Maintainers
1
Weekly downloads
 
Created

What is typia?

Typia is a TypeScript library that provides runtime type checking, validation, and serialization/deserialization capabilities. It aims to enhance type safety and runtime validation for TypeScript applications.

What are typia's main functionalities?

Runtime Type Checking

This feature allows you to perform runtime type checking to ensure that a value matches a specified TypeScript type. The code sample demonstrates how to check if a value is a string at runtime.

const isString = typia.is<string>(value);

Validation

Typia provides validation capabilities to ensure that data conforms to a specified type. The code sample shows how to validate an object against a TypeScript type, returning a result that indicates whether the data is valid.

const validationResult = typia.validate<MyType>(data);

Serialization/Deserialization

Typia can serialize TypeScript objects to JSON strings and deserialize JSON strings back to TypeScript objects, ensuring type safety throughout the process. The code sample demonstrates both serialization and deserialization.

const jsonString = typia.stringify<MyType>(data); const dataObject = typia.parse<MyType>(jsonString);

Other packages similar to typia

Keywords

fast

FAQs

Package last updated on 13 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.