reflect-metadata
arktype

reflect-metadata | arktype | |
---|---|---|
4 | 58 | |
3,294 | 6,292 | |
1.4% | 2.2% | |
7.2 | 9.4 | |
over 1 year ago | 12 days ago | |
TypeScript | TypeScript | |
Apache License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
reflect-metadata
-
Dynamic NestJS Listeners: Discover the Power of Lazy Loading
We could use the reflect-metadata library to store the metadata and then scan it manually to replace the placeholders with actual values, but there is a better way.
- TypeScript please give us types
-
Using modern decorators in TypeScript
Second, TypeScript 5.0 cannot emit decorator metadata. Subsequently, it doesn’t integrate with the Reflect API and won’t work with the reflect-metadata npm package.
-
Deconstructing an Object Relationship Mapper (ORM) in Typescript
Database columns will be mapped to domain object properties using decorators. This will include relationships and enum types. reflect-metadata stores metadata about the classes and properties. Most of the work is a simple map for each class, renaming db column properties to domain model properties and vice versa. Reflect.defineProperty holds a list of field metadata on the target class. This is where more database ORM logic could live in the future such as column type, length, etc. A base domain model entity will use this metadata to map the models appropriately.
arktype
-
Zod v4: 17x Slower? (and Why You Should Care) 🚦
My hunch was that Zod v4 started using eval (or, more precisely, JIT compilation via new Function) for validation. This isn’t a bad thing — libraries like TypeBox, ArkType, and even Sury use similar techniques for speed.
-
Welcome Sury - The fastest schema with next-gen DX 🚀
And while we're at it, I'll quickly show why Sury is the fastest schema library out there. Sury heavily relies on JIT optimizations by inlining all validations and transformations using new Function. It's not something new and used by other libraries like TypeBox, ArkType and even Zod@4. But they mostly do basic validations, while Sury embraces transformations as it's core primitive:
-
ArkType: Ergonomic TS validator 100x faster than Zod
[2] https://github.com/arktypeio/arktype/issues/810
-
TypeScript Types Lie & How to Improve Them
Leveraging type narrowing helper libraries like Zod or ArcType can significantly both reduce the type narrowing you need to do know parsing outside data, reduce lots of boilerplate type narrowing code, and increase type safety. Many of the type lies TypeScript tells are from JSON.parse, converting Errors typed as unknown, or when reading local configuration files. This is where Zod/ArcType can really make a huge positive impact.
-
JavaScript schema library from the Future 🧬
Talking about ArkType, they use the same approach with eval and have similar potential to ReScript Schema, but their evaluated code is not there yet. Currently, their operations are a little bit slower, and the schema creation is significantly slower. But I can see that it can somewhat catch up in the future.
-
Error Handling for fetch in TypeScript
…but that’s a lot of no fun, dangerous work. Better to use a library that has already solved this problem like Zod or ArkType. It’ll ensure the types match up, and if not, give you an error response that _somewhat_ gives you a clue as to why the decoding went wrong, way more thorough and verbose than JSON.parse’s not so great runtime error messages.
-
Encoders and Decoders in TypeScript
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).
- ArkType: TypeScript's 1:1 validator, optimized from editor to runtime
-
ArkType 2.0: Validate 100x faster with DX that will blow your mind
ArkType 2.0 is a no-setup solution for schema validation with a new style of type-safe API that parallels native type syntax while offering validation functionality like Zod or Yup.
It also brings types to runtime in a way they've never been available before. They can be introspected and compared just like `extends` in native TS.
Thanks for your patience, and I couldn't be more hyped to see what you do with it!
GitHub: https://github.com/arktypeio/arktype
Docs: https://arktype.io
Discord: https://arktype.io/discord
-
ArkType 2.0
This has been a long time coming, but I hope the finished product was worth the wait.
ArkType 2.0 is a no-setup solution for schema validation with a new style of type-safe API that parallels native type syntax.
It also brings types to runtime in a way they've never been available before. They can be introspected and compared just like `extends` in native TS.
Thanks for your patience, and I couldn't be more hyped to see what you do with it!
GitHub: https://github.com/arktypeio/arktype
Docs: https://arktype.io
Discord: https//arktype.io/discord
What are some alternatives?
protobuf-ts - Protobuf and RPC for TypeScript
zod - TypeScript-first schema validation with static type inference
di-compiler - A Custom Transformer for Typescript that enables compile-time Dependency Injection
proposal-decorators - Decorators for ES6 classes
typescript-needs-types - TypeScript please give us types.
