crapify.me

A toolkit of oddly specific CLI utilities for developers and vibecoders

quick-start
$ npx crapifyme comments
Remove noisy comments, keep critical ones
$ npx crapifyme logs
Clean up console logs with preservation
$ npx crapifyme imports
Sort, group and clean up imports
$ npx crapifyme deps
Analyse package.json dependencies, bundle size

# Run with --help for all options
# Use --dry-run to preview changes
$
global-install
$ npm install -g crapifyme
Install globally for frequent use
$ crapifyme comments src/
Process specific directory with comments tool
$ crapifyme logs --help
View all available options for logs tool
$ crapifyme chars --fix
Detect non-Latin characters and automatically transliterate

# Run with --help for all options
# Use --dry-run to preview changes
$

# Comments Tool

Comments remover that preserves critical comments while removing noise

comments-usage
$ crapifyme comments
Process current directory with smart preservation
$ crapifyme comments src/
Target specific directory for comment cleanup
$ crapifyme comments --dry-run
Preview changes without modifying any files
$ crapifyme comments --no-preserve-development src/
Remove TODO/FIXME comments, keep others
$ crapifyme comments --keep "copyright,license" src/
Custom patterns to preserve specific comments
$ crapifyme comments --extensions "ts,tsx" --exclude "**/node_modules/**"
Filter by file types and exclude patterns

$

Preserved by default:

  • @ts-ignore, eslint-disable, webpackChunkName
  • TODO, FIXME, HACK, NOTE
  • prettier-ignore, istanbul ignore
  • JSDoc comments ()

# Console Logs Tool

Removes console.log and console.info statements while preserving error, warn, and debug by default

logs-usage
$ crapifyme logs
Remove console.log/info, keep error/warn/debug
$ crapifyme logs src/
Target specific directory for log cleanup
$ crapifyme logs --dry-run
Preview changes without modifying any files
$ crapifyme logs --no-preserve-error --no-preserve-warn
Remove all console methods except debug
$ crapifyme logs --keep "performance,benchmark" src/
Custom patterns to preserve specific logs
$ crapifyme logs --extensions js,ts --exclude dist/
Filter by file types and exclude patterns

$
  • Removed: console.log(), console.info()
  • Preserved: console.error(), console.warn(), console.debug()
  • Always kept: console.assert(), console.trace(), console.time()

# Imports Tool

Sorts, groups, removes unused imports, and handles framework-specific patterns with path alias support

imports-usage
$ crapifyme imports
Complete optimization (default behavior)
$ crapifyme imports --framework=nextjs --alias="@/*:./src/*"
Framework-specific optimization with aliases
$ crapifyme imports --style=absolute
Convert to absolute import paths
$ crapifyme imports --style=relative
Convert to relative import paths
$ crapifyme imports --no-remove-unused
Disable unused import removal
$ crapifyme imports --no-sort --no-group
Disable sorting and grouping features

$

Features enabled by default:

  • Sort imports alphabetically within each group
  • Group by type: external → internal (@/, ~/) → relative (./,../)
  • Remove unused imports via AST analysis and scope detection
  • Merge duplicate imports from same source automatically
  • Framework auto-detection (Next.js, Vite, Svelte, Vue, React, Angular, Nuxt)

# Dependencies Tool

Analyze project dependencies for security vulnerabilities and bundle size

deps-usage
$ crapifyme deps
Complete dependency analysis (all checks enabled)
$ crapifyme deps --size-only
Bundle size analysis with gzip information
$ crapifyme deps --security-only
Security vulnerability analysis only
$ crapifyme deps --outdated-only
Check outdated packages across workspaces
$ crapifyme deps --unused-only --output=tree
Find unused dependencies including dev deps

$

Example output:

┌─────────────────────┬──────────┬──────────┬─────────┐
│ Package             │ Raw      │ Gzipped  │ % Total │
├─────────────────────┼──────────┼──────────┼─────────┤
│ react               │ 2.1MB    │ 628.3KB  │ 45.2%   │
│ @types/node         │ 1.7MB    │ 510.1KB  │ 36.7%   │
│ lodash              │ 287.5KB  │ 86.2KB   │ 6.2%    │
│ axios               │ 213.4KB  │ 64.0KB   │ 4.6%    │
│ moment              │ 168.9KB  │ 50.7KB   │ 4.1%    │
│ uuid                │ 45.2KB   │ 13.6KB   │ 1.0%    │
│ chalk               │ 38.7KB   │ 11.6KB   │ 0.9%    │
│ debug               │ 28.3KB   │ 8.5KB    │ 0.6%    │
│ classnames          │ 15.1KB   │ 4.5KB    │ 0.3%    │
│ tiny-invariant      │ 2.8KB    │ 841B     │ 0.1%    │
└─────────────────────┴──────────┴──────────┴─────────┘

# Unicode Chars Tool

Unicode-to-ASCII transliteration tool for cleaning non-Latin characters from codebases

chars-usage
$ crapifyme chars
Detect non-Latin characters (detection mode)
$ crapifyme chars --fix
Automatically fix detected issues
$ crapifyme chars --strict --fix src/
Strict mode - flag all non-ASCII characters
$ crapifyme chars --ignore-strings --ignore-comments src/
Ignore characters in strings and comments
$ crapifyme chars --severity=high src/
Filter by severity level (low/medium/high/critical)
$ crapifyme chars --extensions "js,ts,py,go" --fix src/
Custom file extensions with automatic fixing

$

Character detection examples:

  • Cyrillic: Привет → Privet (Ukrainian, Bulgarian, Russian)
  • Greek: α β γ δ → a v g d (Mathematical symbols, Greek text)
  • CJK: 你好世界 → NiHaoShiJie (Chinese, Japanese, Korean)
  • Arabic: مرحبا → mrhb (Arabic script)
  • Accented: résumé café → resume cafe (Latin with diacritics)
  • Invisible: Zero-width spaces, byte order marks

# Base64 Tool

Image-to-base64 encoding and decoding with multiple output formats

base64-usage
$ crapifyme base64 image.png
Basic encoding with data URL and CSS formats
$ crapifyme base64 icon.svg --css-only
CSS background-image format only
$ crapifyme base64 logo.png --data-url-only
Data URL format only for HTML embedding
$ crapifyme base64 banner.jpg --raw
Raw base64 string without MIME wrapper
$ crapifyme base64 decode "data:image/png;base64,iVBORw0KGgo..." -o output.png
Decode base64 back to image file

$

Supported Image Formats:

  • PNG, JPG, JPEG Standard web formats
  • SVG Vector graphics with proper MIME
  • GIF, WebP Modern web formats
  • BMP, ICO, TIFF, AVIF Extended support

Output Formats:

  • Data URL For HTML/CSS embedding
  • CSS Background Ready-to-use CSS rule
  • Raw Base64 Plain string without wrapper

Example output:

✔ Encoded: logo.png
  ┣ Original size: 15.3 KB
  ┣ Base64 size: 20.4 KB
  ┣ Overhead: 33.3%
  ┗ MIME type: image/png

Data URL:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA...

CSS Background Image:
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA...");

# SVG Tool

SVG optimization using SVGO with intelligent presets and advanced configuration

svg-usage
$ crapifyme svg
Basic optimization with balanced preset
$ crapifyme svg logo.svg
Optimize specific SVG file
$ crapifyme svg '<svg>...</svg>'
Optimize SVG code directly (outputs to console)
$ crapifyme svg --preset=aggressive assets/
Maximum compression preset for production
$ crapifyme svg --copy --backup icons/
Create copies and backups for safety
$ crapifyme svg --parallel --max-concurrency=8 large-dir/
High-performance batch processing
$ crapifyme svg --watch --preset=balanced src/
Watch mode for development workflow

$

Optimization Presets:

  • minimal 10-30% reduction, preserves structure
  • balanced 30-60% reduction (default)
  • aggressive 50-80% maximum compression

Output Modes:

  • --in-place Overwrite originals (default)
  • --copy Create .optimized.svg copies
  • --backup Create .original.svg backups
  • --output-dir Save to different directory

Advanced Features:

  • --parallel Concurrent processing
  • --multipass Multiple optimization runs
  • --watch Development mode
  • --report JSON/CSV analytics

Example output:

✔ Processed 15 SVG files
  ┣ Original size: 45.2 KB
  ┣ Optimized size: 28.7 KB
  ┣ Bytes saved: 16.5 KB
  ┣ Compression: 36.5%
  ┣ Avg ratio: 1.58:1
  ┗ Processing time: 234.00ms

Language Support

JavaScript/TypeScript

.js, .ts, .jsx, .tsx, .mjs
// Single line
/* Multi line */

Web/Frameworks

.vue, .svelte, .astro, .html, .css
<!-- HTML -->
/* CSS */

Scripts/Config

.py, .sh, .yaml, .yml
# Hash style
Each tool requires version control (Git, SVN, etc.) for safety by default (--force to bypass)
Recommended: Run a formatter like prettier or eslint after using code-changing tools