How to declare a Tree entity in TypeORM using JavaScript

I know that typeorm support tree entities and we can implement it in Typescript with decorator. But I wonder that is there any way to declare a tree entity in JavaScript?

  • I have read the source code of EntitySchemaOptions, but I can’t find any useful information.
  • I also read the source code of EntitySchemaColumnOptions, even there are some attributes such as treeChildren and treeParent, I still don’t know how to use it.