index.ts
is recognized by Node as a default export
reference when a directory path is referenced.
// domainTopLevelDir/<subDir>/index.ts export * from "./someDirName"; export * from "./anotherDirName"; export * from "./anotherModule"; // domainTopLevelDir/index.ts import * as someName from "./someDirName"; import * as otherName from "./anotherDirName"; import * as anotherName from "./anotherModule"; export { // exported variables from each folders are all exported from one location someName, otherName, anotherName, };
Directory Structure
domainTopLevelDir |- index.ts |-someDirName |- index.ts |-someOtherDirectory |- index.ts |-anotherFolder |- index.ts