This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

rescript-struct
TypeScript icon, indicating that this package has built-in type declarations

6.0.0 • Public • Published

CI codecov npm

ReScript Schema (previously rescript-struct)

The fastest composable parser/serializer for ReScript (and TypeScript)

‼️‼️‼️ The package is renamed to rescript-schema. The old rescript-struct name is depreacted.

⚠️ Be aware that rescript-schema uses eval. It's usually fine but might not work in some environments like Cloudflare Workers or third-party scripts used on pages with the script-src header.

Highlights:

  • Combines validation and transformation without a performance loss
  • Can transform parsed value back to the initial format (serializing)
  • Works with any Js value, not only Js.Json.t
  • Support for asynchronous transformations
  • Immutable API with both result and exception-based operations
  • Easy to create recursive schema
  • Detailed error messages
  • Opt-in strict mode for object schema to prevent excessive fields and many more built-in helpers
  • Works with plain JavaScript/TypeScript too! You don't need to use ReScript
  • The fastest composable validation library in the entire JavaScript ecosystem (benchmark)
  • Small JS footprint & tree-shakable API (Comparison with Zod and Valibot)

Also, it has declarative API allowing you to use rescript-schema as a building block for other tools, such as:

Documentation

Dependencies (0)

    Dev Dependencies (13)

    Package Sidebar

    Install

    npm i rescript-struct

    Weekly Downloads

    817

    Version

    6.0.0

    License

    MIT

    Unpacked Size

    376 kB

    Total Files

    14

    Last publish

    Collaborators

    • dzakh