From 922ffe98598ea9ee74de445f541ccb9fcc5bfe38 Mon Sep 17 00:00:00 2001 From: Romain Lanz <2793951+RomainLanz@users.noreply.github.com> Date: Wed, 10 Apr 2024 22:01:42 +0200 Subject: [PATCH] chore: mention reflect-metadata --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c785f6..a1717d8 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ This property can define the dependencies for the class methods (including the c ### TypeScript to the rescue -Wait, you can use decorators with combination of TypeScript's [emitDecoratorMetaData](https://www.typescriptlang.org/tsconfig#emitDecoratorMetadata) option to perform reflection. +Wait, you can use decorators with combination of TypeScript's [emitDecoratorMetaData](https://www.typescriptlang.org/tsconfig#emitDecoratorMetadata) option to perform reflection. You will also need to install [`reflect-metadata`](https://www.npmjs.com/package/reflect-metadata) in order for TypeScript to exract metadata from your classes. It is worth noting, TypeScript decorators are not as powerful as the reflection API in other languages. For example, in PHP, you can use interfaces for reflection. Whereas in TypeScript, you cannot.