ts-exported-info
v1.2.0
Published
A TypeScript/JavaScript analyzer that extracts information about exported members from files
Downloads
805
Maintainers
Readme
ts-exported-info
A TypeScript/JavaScript analyzer that extracts information about exported members from files.
Features
- 📦 Analyze exports from TypeScript and JavaScript files
- 🎯 Filter exports by kind (value, type, mixed)
- 📊 Multiple output formats (console, JSON)
- 🔄 Track re-exported symbols
- 🎨 Beautiful colored console output
Installation
pnpm install -g ts-exported-info
// or
npm install -g ts-exported-infoOr use with npx or pnpx:
npx ts-exported-info <file>Usage
Analyze a single file
ts-exported-info src/index.tsAnalyze a multiple files
ts-exported-info src/index.ts src/exports.tsUse glob
ts-exported-info src/**/index.tsFilter by export kind
ts-exported-info src/index.ts --kind value,typeOutput as JSON
ts-exported-info src/index.ts --output jsonOptions
<file>- File or files path (supports globs)--output <type>- Output format:console(default) orjson--kind <kind>- Filter by export kind:value,type,mixed(comma-separated)
Output Information
For each export, the tool provides:
- Name - The export name
- Kind - Whether it's a
value,type, ormixedexport - File - The source file where the export is defined
- Re-exported - Whether the export is re-exported from another module
Examples
Console Output
$ ts-exported-info src/index.ts
◐ Analyzing...
✔ Found 1 entrypoint(s)
╭────────────────────────────╮
│ │
│ packages/react/src/f0.ts │
│ │
╰────────────────────────────╯
TYPE LinkProps (re-exported)
VALUE Link (re-exported)
TYPE ButtonProps (re-exported)
.......
VALUE dataCollectionLocalStorageHandler (re-exported)
TYPE DataCollectionStorage (re-exported)
TYPE DataCollectionStorageHandler (re-exported)
✔ Found 182 export(s) in packages/react/src/f0.ts
✔ Analysis completed successfully.
✔ Found 182 export(s)
JSON Output
$ ts-exported-info src/index.ts --output json
{
"entrypoints": [
{
"file": "/project/src/index.ts",
"exports": [
{
"name": "myFunction",
"kind": "value",
"file": "/project/src/index.ts",
"reexported": false
},
{
"name": "MyInterface",
"kind": "type",
"file": "/project/src/index.ts",
"reexported": false
}
]
}
]
}Use Cases
- 📝 Generate API documentation
- 🔍 Audit public exports
- 🎯 Validate library interfaces
- 🔄 Track module dependencies
- 📊 Analyze code structure
Author
Sergio Carracedo
- Email: [email protected]
License
ISC
