Auto generate index files for a TypeScript project.

Usage no npm install needed!

<script type="module">
  import studiohyperdriveNamedExports from 'https://cdn.skypack.dev/@studiohyperdrive/named-exports';



Generate index files with named exports for your project.


  • generate named exports in the folder of your choice
  • supports TypeScript projects as well as ECMAScript module syntax


npm install -D @studiohyperdrive/named-exports


yarn add @studiohyperdrive/named-exports


named-exports --dir=src --ext=.ts --exclude=(ignore-this|ignore-that) --include=(include-this|include-that) --fileName=public_api --timeout=10000 --clean=true --indent=space --indentSize=4 --silent


Set the root dir to generate an index file for. All files will be read recursively and any matching export patterns will be added to the index file.
(default .)

Set the extension of files to match.
(default .ts)

Exclude pattern passed to [node-glob](https://github.com/isaacs/node-glob), suffixed with provided ext.
(default *.spec|*.test|*-test|*-spec)

Set the extensions of files to match. Include pattern passed to [node-glob](https://github.com/isaacs/node-glob).
(default ts|tsx)

Set the name of the generated file.
(default index)

Set a max timeout for the script to finish execution.
(default 30000)

Cleanup remaining index files from previous builds.
(default true)

Choose indentation style ("space" or "tab").
(default space)

Choose indentation size.
(default 2)

Disable logs.

Contributing (Issue/PR)

Make sure to add your issue, question or feature request to the issue tracker and fire away!