How to get all decorated classes in Node.js?

48 Views Asked by At

I have many decorated classes in different files. Is it possible to get all these classes in one place using a decorator? In addition, I use the tsyringe library to create decorators. Maybe it has the ability to get classes by decorator?

`export function registerClass() {......}


//path1
@registerClass()
export class ExampleClass1

//path2
@registerClass()
export class ExampleClass2


//path3
How to get all classes with @registerClass() decorator in another file? Is this possible with the 'reflect-metadata' library?`

I tried the 'reflect-metadata' library but I couldn't get all classes by decorator

0

There are 0 best solutions below