Run js-beautify on BBEdit's frontmost text document. Based on isao/bbjshint
Note that for now, BBEdit will tell you that the file was edited on the filesystem, and must be saved to retain the results from
Use from BBEdit's Scripts menu by either installing or symlinking
bbjsbeautify to BBEdit's Scripts folder. This is
~/Library/Application Support/BBEdit/Scripts or perhaps
~/Dropbox/Application Support/BBEdit/Scripts. You can show this folder from BBEdit by going to the scripts menu and choosing "Open Scripts Folder".
npm install --global bbjsbeautify cd ~/Library/Application\ Support/BBEdit/Scripts ln -s `which bbjsbeautify`
jsbeautify-opts.json to taste.
There are three script files to choose from and hotkey:
- index.js relies
opts.replaceto decide if the results are written or displayed.
- display.js will not write to file, but will show results in an output window.
- replace.js will overwrite the file with the results.