Skip to content
CLI tools

generate-index-file

A CLI that generates an index.ts of re-exports from a list of files or folders — no more hand-rolled barrel files.

Created Last commit
  • cli
  • typescript
  • javascript
  • codegen

generate-index-file

generate-index-file takes a list of files or folders and emits an index.ts with all the export … from './…' lines you'd otherwise type by hand. The classic barrel file that ends up in every component library — generated, not hand-maintained.

I wrote it because keeping barrels manually is that small kind of friction that piles up: you add a new file, forget to export it, spend five minutes debugging why an import won't resolve. This CLI regenerates the barrel in a second and removes the step from the loop.

For usage details, see the README on GitHub.