1.1.0 • Published 9 months ago
import-content-collector v1.1.0
Import Content Collector
A CLI tool that collects and combines the content of a TypeScript/JavaScript file along with all its local imports into a single output file. Perfect for sharing code snippets or creating self-contained examples.
Features
- Collects content from the main file and all its local imports
- Supports TypeScript and JavaScript files
- Handles both ES6 imports and CommonJS requires
- Supports JSX and TypeScript decorators
- Prevents duplicate processing of files
- Generates a well-formatted output with file headers
Installation
npm install -g import-content-collector
Usage
Command Line
import-collect <source-file> [-o output-file]
Options:
<source-file>
: Path to the source file (required)-o, --output
: Output file name (default: "collected-content.txt")
Example:
import-collect src/index.ts -o combined.txt