Web Dev
JS Minifier
Minify or beautify JavaScript code.
How to use it
- Open Devly from the wrench in your menu bar, or press ⌃⌥⌘D. Press ⌘P, type JS Minifier and press Return.
- Choose Minify or Beautify at the top.
- Paste or type your text into Input.
- Adjust the Options on the right if you need to. The defaults are listed below.
- Press Minify, or ⌘↵.
- To go the other way, press Swap or ⌘S. The output moves into the input.
- Use Copy or ⇧⌘C to copy the result. ⌘L clears everything.
Options
| Option | Values | Default |
|---|---|---|
| Indent SpacesIndentation for beautify mode | 1–8 | 2 |
| Remove commentsStrip JavaScript comments | On or off | On |
| Remove console.logRemove console.log statements | On or off | Off |
Example
Real output from Devly, with the default options.
Input
function greet(name) {
// Say hello
const message = `Hello, ${name}!`;
console.log(message);
return message;
}
greet('Devly');function greet(name){const message=`Hello, ${name}!`;console.log(message);return message;}greet('Devly');From Terminal
With the free command-line tool installed:
Terminal
devly js --path input.txt # or pipe text in pbpaste | devly js
Quick Switch also finds it by: javascript, js, minify, beautify, compress, uglify.