Encoders and Decoders in TypeScript

This page summarizes the projects mentioned and recommended in the original post on dev.to

Civic Auth - Auth in Less Than 5 Minutes
Civic Auth comes with multiple SSO options, optional embedded wallets, and user management — all implemented with just a few lines of code. Start building today.
www.civic.com
featured
CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
  1. proposal-is-error

    ECMAScript Proposal, specs, and reference implementation for Error.isError

    Caveat: You’ll see if(error instanceof Error) example code. The instanceof keyword isn’t great for runtime type checking in all cases, so in the future use Error.isError(error) where applicable. At the time of this writing, the proposal is Stage 3, which means browsers intend to implement, and TypeScript will start to implement as well.

  2. Civic Auth

    Auth in Less Than 5 Minutes. Civic Auth comes with multiple SSO options, optional embedded wallets, and user management — all implemented with just a few lines of code. Start building today.

    Civic Auth logo
  3. zod

    TypeScript-first schema validation with static type inference

    As you can see, encoding and decoding in TypeScript can make your code safer, reduce the amount of type narrowing you need to do, especially if you use Zod. For consumers of your code and api’s, it gives them the flexibility of utilizing your API’s while providing their own types which includes their own encoders and decoders in a type-safe way. TypeScript can safely ensure all erros are typesafe, and those error scenarios are handled in developers who use your code.

  4. arktype

    TypeScript's 1:1 validator, optimized from editor to runtime

    You can get an unknown return value, so you’ll have to type narrow to your type. (We’ll avoid doing type narrowing in this post and assume you’ll use something like Zod or ArkType heavily in your decoders).

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • TypeScript Types Lie & How to Improve Them

    2 projects | dev.to | 19 Mar 2025
  • Using Arktype in Place of Zod - How to Adapt Parsers

    4 projects | dev.to | 12 Jun 2024
  • Build a RAG Chat App with Firebase Genkit and Astra DB

    3 projects | dev.to | 15 Apr 2025
  • Leveraging the TS type system with APIs: Validation, error handling and free OpenAPI specs

    2 projects | dev.to | 3 Apr 2025
  • All in on CLINE

    2 projects | dev.to | 2 Mar 2025

Did you know that TypeScript is
the 1st most popular programming language
based on number of references?