When you are working with javascript, is not easy to know type :
- typeof x
- Array.isArray(x)
- isNaN(x)
Example where database return error
Javascript + Type Checking = Typescript
Typescript FAQ (microsoft/TypeScript repository)
- AJV (Eslint, Indeed, Salesforce ...) -> JSON Validator
- Weekly Downloads: 30 023 955
- Use in Fastify Framework
- Joi (Brave, Beat Musique, Vrbo ...) -> JS Validator
- Weekly Downloads: 4 233 791
- Use in Hapi Framework
- check-types.js -> JS Validator
- Weekly Downloads: 3 042 559
12 May 2020
- Most used library
90 contributors 🏗 | 5,000 dependent npm packages ⚙️ |7,000 github stars ⭐️
5,000,000 dependent repositories 🚀 |120,000,000 npm downloads per month! 💯
- Base on JSON Schema Standard -> http://json-schema.org
- Use JSON format
- Can be use on every project : Browser / Mobile / Server
- Can be use on every language who implement this standard
Example : Golang Package -> gojsonschema
Library | Mean Latency | Total in Seconds |
---|---|---|
AJV | 0.6 ms | 6.21s |
JOI | 3.3 ms | 33.22 s |
Performance Test
10000 requests
Macbook 2019 I7 2.6Ghz / 16go DDR4 |Node v10.16.3
Report : https://raw.githubusercontent.com/qlaffont/ts-is-not-the-complete-answer/master/perf-tests/perf-test.report.txt