Reflect-metadata is a polyfill and prototype implementation of a Metadata Reflection API for ECMAScript that enables decorators to attach and retrieve metadata on classes and their members.
The tool solves the problem of adding and accessing metadata on classes in a consistent, language-level way. It provides a reflective API that allows decorators and other code to define metadata declaratively through decorator syntax or imperatively through Reflect methods, and then introspect that metadata at runtime. The implementation stores metadata in internal properties on objects and their prototypes, organized by property keys, and exposes operations through the Reflect object to read, write, and check for metadata existence.
Developers using TypeScript's legacy experimentalDecorators option should adopt this package to enable metadata-driven patterns like dependency injection, runtime type assertions, and reflection-based testing. The tool is particularly suited for frameworks and libraries that need a standardized way to reason over metadata attached by multiple decorators. While the proposal itself is no longer being considered for standardization now that TC39 has advanced the Decorators and Decorator Metadata proposals to Stage 3, this package continues to support projects that cannot yet migrate away from TypeScript's experimental decorator implementation.
The project maintains active support for existing users despite the shift in standardization direction, indicating a commitment to backward compatibility for projects relying on the experimental decorators feature. Development activity focuses on sustaining the implementation for legacy codebases rather than expanding the API surface.