All Projects → moltar → Typescript Runtime Type Benchmarks

moltar / Typescript Runtime Type Benchmarks

Benchmark Comparison of Packages with Runtime Validation and TypeScript Support

Programming Languages

typescript
32286 projects
types
53 projects

Projects that are alternatives of or similar to Typescript Runtime Type Benchmarks

Partial.lenses.validation
Partial Lenses Validation is a JavaScript library for validating and transforming data
Stars: ✭ 39 (-67.23%)
Mutual labels:  json, validation
Fhir.js
Node.JS library for serializing/deserializing FHIR resources between JS/JSON and XML using various node.js XML libraries
Stars: ✭ 61 (-48.74%)
Mutual labels:  json, validation
Schemas
All schemas used for validation that are shared between our projects
Stars: ✭ 51 (-57.14%)
Mutual labels:  json, validation
Cti Stix Validator
OASIS TC Open Repository: Validator for STIX 2.0 JSON normative requirements and best practices
Stars: ✭ 24 (-79.83%)
Mutual labels:  json, validation
Fluidvalidator
General purpose validation system for objects, nested objects, enumerables written in Swift
Stars: ✭ 89 (-25.21%)
Mutual labels:  validation, validation-library
Laravel Vue Validator
Simple package to display error in vue from laravel validation
Stars: ✭ 32 (-73.11%)
Mutual labels:  validation, validation-library
Govalid
Data validation library for golang. [MIGRATING TO NEW ADDRESS]
Stars: ✭ 59 (-50.42%)
Mutual labels:  json, validation
Specs
Technical specifications and guidelines for implementing Frictionless Data.
Stars: ✭ 403 (+238.66%)
Mutual labels:  json, validation
Mson React
React and Material-UI Rendering Layer for MSON
Stars: ✭ 74 (-37.82%)
Mutual labels:  json, validation
Schemasafe
A reasonably safe JSON Schema validator with draft-04/06/07/2019-09 support.
Stars: ✭ 67 (-43.7%)
Mutual labels:  json, validation
Winterfell
Generate complex, validated and extendable JSON-based forms in React.
Stars: ✭ 787 (+561.34%)
Mutual labels:  json, validation
Json Benchmark
nativejson-benchmark in Rust
Stars: ✭ 93 (-21.85%)
Mutual labels:  json, benchmark
Encoding
Go package containing implementations of efficient encoding, decoding, and validation APIs.
Stars: ✭ 705 (+492.44%)
Mutual labels:  json, validation
Val
golang JSON validation library.
Stars: ✭ 37 (-68.91%)
Mutual labels:  json, validation
Govalidator
[Go] Package of validators and sanitizers for strings, numerics, slices and structs
Stars: ✭ 5,163 (+4238.66%)
Mutual labels:  validation, validation-library
Lcformvalidation
Javascript based form validation library, third party library / framework agnostic.
Stars: ✭ 58 (-51.26%)
Mutual labels:  validation, validation-library
Schema
📐 Validating data structures against a given Schema.
Stars: ✭ 359 (+201.68%)
Mutual labels:  json, validation
Mson
🏗️MSON Lang: Generate an app from JSON
Stars: ✭ 378 (+217.65%)
Mutual labels:  json, validation
Vee Validate
✅ Form Validation for Vue.js
Stars: ✭ 8,820 (+7311.76%)
Mutual labels:  validation, validation-library
Validator Collection
Python library of 60+ commonly-used validator functions
Stars: ✭ 91 (-23.53%)
Mutual labels:  validation, validation-library

📊 Benchmark Comparison of Packages with Runtime Validation and TypeScript Support

⚠️ Note: Until #497 is resolved, some of the benchmarks in this repo are comparing apples-to-oranges due to the different APIs provided by validation libraries. Libraries which provide more functionality (like transformations, coercions, detailed errors) might be penalized for slower performance for those extra features.

Packages Compared

Criteria

Validation

These packages are capable of validating the data for type correctness.

E.g. if string was expected, but a number was provided, the validator should fail.

Interface

It has a validator function or method that returns a valid type casted value or throws.

const data: any = {}

// `res` is now type casted to the right type
const res = isValid(data)

Or it has a type guard function that in a truthy block type casts the value.

const data: any = {}

function isMyDataValid(data: any) {
  // isValidGuard is the type guard function provided by the package
  if (isValidGuard(data)) {
    // data here is "guarded" and therefore inferred to be of the right type
    return data
  }

  throw new Error('Invalid!')
}

// `res` is now type casted to the right type
const res = isMyDataValid(data)

Benchmark Results

Data Type Checks

Node 10.x (JSON, CSV, SVG)

Bar Graph - Node 10.x

Node 12.x (JSON, CSV, SVG)

Bar Graph - Node 12.x

Node 13.x (JSON, CSV, SVG)

Bar Graph - Node 13.x

Node 14.x (JSON, CSV, SVG)

Bar Graph - Node 14.x

Data Type Checks Sans Outliers

Because some packages are so performant it makes it difficult to see the benchmarks for other packages.

This benchmark run includes all of the above packages, but excludes marshal and ts-json-validator.

Node 10.x (JSON, CSV, SVG)

Bar Graph - Node 10.x

Node 12.x (JSON, CSV, SVG)

Bar Graph - Node 12.x

Node 13.x (JSON, CSV, SVG)

Bar Graph - Node 13.x

Node 14.x (JSON, CSV, SVG)

Bar Graph - Node 14.x

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].