Bookmarklet and REST API for prettier

This is now locked on glitch due to a Content Security Policy directive

Send me a Javascript buffer in the body of a post and I'll return the prettier version of the buffer in the body of the response (as long as it's valid javascript).

I built this because I got so used to prettier reformatting my javascript on save in my usual text editors that I wanted glitch to do the same. Now I can, thanks to bookmarklets and... Glitch itself!

You can install it in your bookmark bar as a bookmarklet, just drag the follong link to your bookrmark bar:

Make Prettier

You can use this bookmarklet on any webpage with a CodeMirror editor containing javascript. Of course you can rename it whatever you like.

Here is an example with the code of the bookmarklet itself which is minified on a single line. Clicking Format will send it to the Glitch backend and format it with prettier.