
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@libria/ts-barrels
Advanced tools
A simple, fast TypeScript barrel file generator that recursively creates index.ts exports for your project.
Barrel files (typically index.ts) re-export modules from a directory, enabling cleaner imports:
// Without barrels
import { UserService } from './services/user/UserService';
import { AuthService } from './services/auth/AuthService';
// With barrels
import { UserService, AuthService } from './services';
npm install @libria/ts-barrels
npx ts-barrels <root> [options]
| Option | Description | Default |
|---|---|---|
<root> | Root folder to generate barrels in | (required) |
--all | Generate barrels recursively from leaves to root | false |
--force | Overwrite existing barrel files | false |
--name <filename> | Custom barrel filename | index.ts |
Generate barrels for the entire src directory:
npx ts-barrels src --all
Generate with a custom filename:
npx ts-barrels src --all --name barrel.ts
Force regenerate all barrels:
npx ts-barrels src --all --force
Ignore a folder from barrel generation:
npx ts-barrels ignore src/internal
import { generateBarrels } from '@libria/ts-barrels';
await generateBarrels('./src', {
all: true,
force: false,
filename: 'index.ts'
});
To prevent a barrel file from being overwritten, add a skip comment at the top:
// @libria/ts-barrels skip
export * from './custom-export';
export { specific } from './module';
Files with the skip comment are always preserved, even when using --force.
To completely exclude a folder (and all its children) from barrel generation, create a .lbbign marker file in that folder:
npx ts-barrels ignore src/internal
This creates a .lbbign file in src/internal. When generating barrels, any folder containing .lbbign will be skipped entirely:
This is useful for internal modules, generated code, or any directory you want to exclude from your public API.
Given this structure:
src/
features/
auth/
login.ts
logout.ts
users/
create.ts
delete.ts
utils/
helpers.ts
Running npx ts-barrels src --all generates:
src/
index.ts -> export * from './features'; export * from './utils';
features/
index.ts -> export * from './auth'; export * from './users';
auth/
index.ts -> export * from './login'; export * from './logout';
users/
index.ts -> export * from './create'; export * from './delete';
utils/
index.ts -> export * from './helpers';
MIT
FAQs
Simple TypeScript barrel generator for typescript projects
We found that @libria/ts-barrels demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.