A command-line tool to convert TypeScript (.ts) and TSX (.tsx) files to JavaScript (.js) and JSX (.jsx) files.
- Converts TypeScript/TSX files to JavaScript/JSX while preserving code structure
- Supports both single file and directory conversion
- Recursive directory processing
- Skips node_modules and hidden directories
- Dry-run mode to preview conversions
- Verbose output option for debugging
- Tracks and reports conversion success/failure statistics
Run the tool using Node.js:
npx ttj [options]-d, --dir <directory>: Specify directory to convert (defaults to current working directory)-f, --file <file>: Convert a single file-r, --dry-run: Preview files that would be converted without making changes-v, --verbose: Show detailed output-V, --version: Display version number-h, --help: Display help information
Convert a single file:
npx ttj -f src/index.tsConvert all files in a directory:
npx ttj -d srcDry run to preview conversions:
npx ttj -d src --dry-runVerbose output:
npx ttj -d src --verboseThis project is licensed under the MIT License - see the LICENSE file for details.
This project was inspired by and built with reference to the following amazing projects:
A big thank you to the maintainers and contributors of these projects!