HomeToolsAbout a20k

Index Export

index.ts is recognized by Node as a default export reference when the directory path is referenced

// domainTopLevelDirectory/someSubDirectory/index.ts export * from "./someFileName"; export * from "./anotherFileName"; export * from "./anotherModule"; // domainTopLevelDirectory/index.ts import * as someName from "./someSubDirectory"; import * as otherName from "./someOtherDirectory"; import * as anotherName from "./anotherFolder"; export { // exported variables from someFileName, anotherFileName, and anotherModule are all exported someName, otherName, anotherName, };

Directory Structure

domainTopLevelDirectory |-someSubDirectory |- index.ts |-someOtherDirectory |- index.ts |-anotherFolder |- index.ts
© VincentVanKoh