Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more! Learn more →
Io-ts Alternatives
Similar projects and alternatives to io-ts
-
-
-
Appwrite
Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!
-
-
-
TypeScript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
joi
The most powerful data validation library for JS [Moved to: https://github.com/hapijs/joi]
-
-
InfluxDB
Build time-series-based applications quickly and at scale.. InfluxDB is the Time Series Platform where developers build real-time applications for analytics, IoT and cloud-native services. Easy to start, it is available in the cloud or on-premises.
-
ajv
The fastest JSON schema Validator. Supports JSON Schema draft-04/06/07/2019-09/2020-12 and JSON Type Definition (RFC8927)
-
Superstruct
A simple and composable way to validate data in JavaScript (and TypeScript).
-
class-transformer
Decorator-based transformation, serialization, and deserialization between objects and classes.
-
openapi-generator
OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
-
typescript-eslint
:sparkles: Monorepo for all the tooling which enables ESLint to support TypeScript
-
-
-
-
-
-
-
ts-pattern
🎨 The exhaustive Pattern Matching library for TypeScript, with smart type inference.
-
marshal.ts
A new full-featured and high-performance TypeScript framework for enterprise applications.
-
Sonar
Write Clean JavaScript Code. Always.. Sonar helps you commit clean code every time. With over 300 unique rules to find JavaScript bugs, code smells & vulnerabilities, Sonar finds the issues while you focus on the work.
io-ts reviews and mentions
- libraries you are happy that you discovered them
- Is React for small projects an Overkill?
-
Typescript advanced bits: function overloading, never and unknown types
A good way to significantly improve the reliability of your app is via improving type-safety by moving away from using any to unknown. One relevant example could be when you type your backend responses and when stringifying JSON to using unknown combined with some sort of runtime type checking. It can be done either by using built-in functionality like type guards or using an external library like io-ts, zod or yup.
-
I found 10,000x faster TypeScript validator library
Usage of TypeBox is similar with io-ts and zod, but it is much powerful and faster than them. Also, TypeBox can generate JSON schema very easily. Therefore, if you're looking for a validator library for new project and not suffering from legacy codes, I think TypeBox would be much better choice than io-ts and zod. TypeBox can totally replace them.
-
Validate your data with Zod
This check can be done with different libraries like: io-ts, typebox, or zod. These libraries allow you to create objects that represent your typescript definitions. Then, these objects can be used at runtime to validate the received data, in addition, you can also convert this object to a Typescript definition to have all the benefits of using typescript. These objects can be called schema validations because they are responsible for the data validation.
-
TypeScript-JSON is 10 ~ 1,000x times faster than ZOD and IO-TS
Being proud of such performance enhancement, I hope many TypeScript developers to adapt my library. Advantage of typescript-json is not only better performance, but also easy usage exists. typescript-json does not require any extra schema definition and just requires only one line with pure TypeScript Type. Thus, what about using my library typescript-json instead of io-ts or zod?
-
Ezno
It's not external to TS. You write your types by passing object literals to the functions that generate the validators; TypeScript then infers shockingly precise types, which can be extracted using TypeScript's type manipulation utilities.
It does support generics [0].
[0] https://github.com/gcanti/io-ts/blob/master/index.md#generic...
You can use io-ts [0] to define your types, and it'll generate functions to typecheck for you. Syntactically it's a bit gnarly and the documentation isn't great; a first-party solution would definitely be nicer. But it works, and it's amazing that it works.
-
Learn how to unleash the full potential of the type system of TypeScript
fp-ts [0] and the accompanying io-ts [1] are very well designed and neatly implemented. I'd consider them the reference for all things FP in Typescript.
In practice though I find that they don't mesh well with the language and ecosystem at large. Using them in a React/Vue/Whatever app will catch you at every step, as neither the language nor the frameworks have these principles at their core. It takes a lot of effort to escape from their gravitational pull. Using Zod [2] for your parsing needs and strict TS settings for the rest feel more natural.
It could work in a framework-agnostic backend or logic-heavy codebase where the majority of the devs are in to FP and really want / have to use Typescript.
0 - https://gcanti.github.io/fp-ts/
1 - https://gcanti.github.io/io-ts/
2 - https://zod.dev
-
What should we do if we have a variable whose value we dont know what it will be ?
The thing you're looking for is a library like zod or io-ts, which allow you to build arbitrarily complex type guards, without having to separately declare a matching type or interface. TypeScript infers the type from the type checker.
-
A note from our sponsor - Appwrite
appwrite.io | 5 Feb 2023
Stats
gcanti/io-ts is an open source project licensed under MIT License which is an OSI approved license.