Parsix: Parse Don't Validate

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • assert-combinators

    Functional assertion combinators.

  • Once i/o boundaries are parsing unknown types into static types, your type safety is guaranteed.

    [0] https://github.com/appliedblockchain/assert-combinators

  • TypeScript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • This is not yet possible in Typescript, but imagine if you could define a numerical subtype that requires your input be below some threshold eg:

    `type Limit = 0..100;`

    See discussion here: https://github.com/Microsoft/TypeScript/issues/15480

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • zod

    TypeScript-first schema validation with static type inference

  • Not exactly what you want, I think, but there is zod [0].

    I really would like to see nominal typing support in TypeScript. Currently, it's hard to validate a piece of data (or parse for that matter) once and have other functions only operate on that validated data. There are (ugly?) workarounds though [1].

    [0]: https://github.com/colinhacks/zod

  • io-ts

    Runtime type system for IO decoding/encoding

  • It doesn't use json schema, but you might be interested in something like this: https://gcanti.github.io/io-ts/

  • fefe

    Validate, sanitize and transform values with proper TypeScript types and zero dependencies.

  • parsix

    Parse, don't validate (by parsix)

  • Well, it's a minimal framework. Parsers are supposed to implement a particular function definition [1] and use the "Parsed" type for their return value, which if widely adopted, will result in references to the core library's types appearing in a lot of API's.

    The advantage is that you can write code using generics that works with any parser, but I'm a little skeptical about the value of generic code.

    [1] https://github.com/parsix/parsix#build-your-own-parse

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