ts-minifer
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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 generation
  • excludePatterns: Files/directories to ignore
  • customNamePatterns: Custom renaming rules

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

MIT License, see LICENSE for more details.

Package Sidebar

Install

npm i ts-minifer

Weekly Downloads

12

Version

1.0.1

License

MIT

Unpacked Size

57.6 kB

Total Files

40

Last publish

Collaborators

  • shubham-tech