beautifier/js-beautify — reverse-engineered prompt

Reverse engineered prompt

Build me a simple code beautifier that takes messy JavaScript, HTML, and CSS and reformats it into clean, nicely indented code. I want it to work in a browser page where I can paste code, choose a few formatting options like indent size and spacing, and instantly see the cleaned up result. It should also be usable from the command line so I can run it on files and get the output printed or saved.

Please make it work as a small library too, so someone can call functions to beautify JavaScript, HTML, or CSS from their own code. If there is a Python version, keep that focused on JavaScript formatting only. It would be great if it can handle ugly bookmarklet style code and do a decent job unpacking or cleaning up some packed or obfuscated JavaScript.

Keep the project practical and easy to try locally. Add a few tests and examples so it is clear how to use it. Look up current docs online if you need to.

Want more depth? Deep Reverse