A simple CLI tool that creates barrel files for TS directories. This is a project to help me learn working with the filesystem in Rust.
src
- components
- Header.tsx
- Header.test.tsx
- Header.stories.tsx
- server.ts
- utils
- index.ts
- <...files.ts>
barrel src # Adds an index.ts file in the src directory
Outputs:
export * from 'server';
export * from 'utils';
The components
directory was avoided because there is not a barrel file in it.
To create a barrel file for components
:
barrel src/components # Adds an index.ts file in src/components
Outputs:
// Named export example:
export * from 'Header';
// Default export example:
export { default as Header } from 'Header';