ts-minifer
v1.0.1
Published
Advanced TypeScript code minification and compression tool
Downloads
119
Maintainers
Readme
TypeScript Minifier
Overview
ts-minifier
is an advanced TypeScript compression tool that provides flexible code minification with comprehensive configuration options.
Features
- 🚀 Multiple Compression Levels
- 📦 Single and Multiple File Output
- 🗺️ Source Map Generation
- 🔍 Detailed Logging
- 💻 CLI and Programmatic APIs
Installation
npm install ts-minifier
CLI Usage
# Basic usage
npx ts-minifier -i src/**/*.ts
# Specify compression level
npx ts-minifier -i src -l aggressive
# Generate source maps
npx ts-minifier -i src -m
# Use configuration file
npx ts-minifier -c compress.config.json
Programmatic Usage
import {
TypeScriptCompressor,
CompressionLevel
} from 'ts-minifier';
const compressor = new TypeScriptCompressor(true);
const result = compressor.compressFiles(['src'], {
level: CompressionLevel.MINIMAL,
outputFormat: 'single',
generateSourceMaps: true
});
console.log(result.stats);
Configuration Options
level
: Compression intensity (none
,minimal
,aggressive
)outputFormat
: Output style (single
,multiple
)generateSourceMaps
: Enable/disable source map generationexcludePatterns
: Files/directories to ignorecustomNamePatterns
: Custom renaming rules
Contributing
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
License
MIT License, see LICENSE for more details.