Lightweight ES Module implementation of reflect-metadata
npm install @abraham/reflection



Lightweight ES Module implementation of reflect-metadata to work with TypeScript's experimental decorator support.
The main reason for this library is to provide a much smaller implementation that can be included as a module.
- ES module
- reflection can be loaded with
- Size (uncompressed)
- reflect-metadata is ~50K
- core-js/es7/reflect is ~80K
- @abraham/reflection is ~3K
Read about how to drop 20K from your production Angular app by switching to this.
``sh`
npm install @abraham/reflection
`ts`
import '@abraham/reflection';
Reflect.defineMetadata(metadataKey, metadataValue, target);
You can also import Reflection:
`ts`
import { Reflection as Reflect } from '@abraham/reflection';
Reflect.defineMetadata(metadataKey, metadataValue, target);
Reflection does not currently cover the complete API surface of reflect-metadata. The following methods are available:
`ts``
Reflect.decorate(...);
Reflect.defineMetadata(...);
Reflect.getMetadata(...);
Reflect.hasMetadata(...);
Reflect.getOwnMetadata(...);
Reflect.hasOwnMetadata(...);
Reflect.metadata(...);