Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Lightweight (3K) ES Module implementation of reflect-metadata

License

NotificationsYou must be signed in to change notification settings

abraham/reflection

Repository files navigation

Version StatusBuild Statusnpm bundle size (minified + gzip)Coverage Status

Reflection

Lightweight ES Module implementation ofreflect-metadata to work with TypeScript'sexperimental decorator support.

Why?

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<script type="module" src="..."></script>
  • Size (uncompressed)

Read about how todrop 20K from your production Angular app by switching to this.

Install

npm install @abraham/reflection

Usage

import'@abraham/reflection';Reflect.defineMetadata(metadataKey,metadataValue,target);

You can also importReflection:

import{ReflectionasReflect}from'@abraham/reflection';Reflect.defineMetadata(metadataKey,metadataValue,target);

API

Reflection does not currently cover the complete API surface of reflect-metadata. The following methods are available:

Reflect.decorate(...);Reflect.defineMetadata(...);Reflect.getMetadata(...);Reflect.hasMetadata(...);Reflect.getOwnMetadata(...);Reflect.hasOwnMetadata(...);Reflect.metadata(...);

[8]ページ先頭

©2009-2025 Movatter.jp