This is possible using the special export = ... syntax as follows:
class MyModule { get abc() { return "abc"; } } var myModule = new MyModule(); export = myModule;
This makes the instance of the MyModule class valid as a module API. You do not need to put any data in the class - just move your functions to it and otherwise leave them unchanged. The disadvantage is that if function a calls function b , it will have to say this.b() or myModule.b() (the latter is closer to the normal module export).
Also you need to declare a named variable first. You cannot just say:
export = new MyModule();
source share