Advanced LLM-powered JavaScript unminifier and deobfuscator
npm install @roeintheglasses/re-scriptre-Script transforms minified and obfuscated JavaScript into readable code using AI models like Claude, GPT-4, or local LLMs. It combines traditional tools like webcrack and Babel with intelligent variable renaming.
- Multi-LLM support (OpenAI, Anthropic, Ollama, Azure, Bedrock)
- Batch processing for multiple files or directories
- AST-aware code splitting
- Response caching to reduce API costs
- Error recovery when processing steps fail
- File-based configuration with CLI overrides
- Real-time progress tracking
- Dry run mode
- Watch mode for automatic processing
``bash`
npm install -g @roeintheglasses/re-script
`bashInteractive setup (recommended for first time)
re-script init
$3
Create config with interactive setup:
`bash
re-script init
`Or manage config manually:
`bash
Show current config
re-script config showSet values
re-script config set provider.name anthropic
re-script config set provider.apiKey "your-key"Validate config
re-script config validate
`Examples
`bash
Single file
re-script bundle.min.jsMultiple files
re-script file1.min.js file2.min.jsDirectory with pattern
re-script src/ --pattern "*.min.js" --recursiveDry run to preview changes
re-script app.min.js --dry-runCustom output location
re-script app.min.js --output app.readable.jsExclude patterns
re-script src/ --recursive --exclude "node_modules/*" ".test.js"High concurrency
re-script src/ --recursive --concurrency 10
`$3
`bash
OpenAI
re-script app.min.js --provider openai --model gpt-4oAnthropic
re-script app.min.js --provider anthropic --model claude-3-5-sonnet-20241022Local Ollama
re-script app.min.js --provider ollama --model codellama:13bAzure OpenAI
re-script app.min.js --provider azure --model gpt-4o
`Configuration
$3
re-Script looks for:
-
.rescriptrc.json
- .rescriptrc.yaml
- rescript.config.js
- package.json (in rescript field)$3
`bash
export ANTHROPIC_API_KEY=your-key-here
export OPENAI_API_KEY=your-key-here
export OLLAMA_BASE_URL=http://localhost:11434
export RESCRIPT_DEBUG=true
`$3
`bash
Show current config
re-script config showShow with environment variables
re-script config show --envSet values
re-script config set provider.name openai
re-script config set provider.model gpt-4oGet values
re-script config get provider.nameList all available keys
re-script config listValidate configuration
re-script config validate
`Additional Commands
`bash
Show usage examples
re-script examplesInteractive setup wizard
re-script initHelp and version
re-script --help
re-script --version
`How It Works
re-Script processes files through a 4-step pipeline:
1. Webcrack Processing - Reverse bundling and deobfuscation
2. Babel Transformations - AST-based code improvements
3. LLM Processing - AI-powered variable/function renaming
4. Code Formatting - Final prettification
Each step can fail gracefully without breaking the pipeline. Responses are cached to reduce API costs.
Supported Models
OpenAI:
gpt-4o, gpt-4o-mini, gpt-4-turbo, gpt-4, gpt-3.5-turboAnthropic:
claude-3-5-sonnet-20241022, claude-3-5-haiku-20241022, claude-3-opus-20240229, claude-3-sonnet-20240229, claude-3-haiku-20240307Azure: Same as OpenAI models but hosted on Azure
Ollama:
llama3:8b, llama3:70b, codellama:13b, codellama:34b, mistral:7b, deepseek-coder:6.7bDevelopment
$3
`bash
git clone https://github.com/roeintheglasses/re-Script.git
cd re-Script
npm install
npm run build
npm link
`$3
`bash
npm test
npm run test:coverage
`$3
`bash
npm run dev # TypeScript watch mode
`Troubleshooting
$3
API Key Errors
`bash
re-script config set provider.apiKey your-key-here
or
export ANTHROPIC_API_KEY=your-key-here
`Rate Limiting
`bash
re-script config set processing.concurrency 1
re-script config set processing.retries.maxDelay 60000
`Large Files
`bash
re-script config set processing.chunking.maxChunkSize 2000
re-script config set provider.maxTokens 4096
`Memory Issues
`bash
re-script config set processing.caching.backend file
node --max-old-space-size=8192 $(which re-script) large-file.js
`$3
`bash
re-script --verbose input.js
or
export RESCRIPT_DEBUG=true
``MIT License - see LICENSE file for details.
Contributions welcome! Open an issue or submit a PR.
- Issues: GitHub Issues
- Discussions: GitHub Discussions