I was going to create a quick webpage to do it for me, but that would have still required me to do a lot of manual copy-n-pasting (copying the html into a form, clicking a button, and pasting the result into a new file).
What I really wanted was a one liner that I could use in my terminal.
I ended up using a combination of cat and sed to get my desired output. The combined result is a shell script called: tojs.
You can install it by running the following commands:
THE FOLLOWING INSTALLATION INSTRUCTIONS ARE OUTDATED. SEE THE UPDATED SECTION BELOW.
sudo curl https://raw.github.com/skratchdot/tojs/1.1.0/tojs.sh -o /usr/local/bin/tojs sudo chmod +x /usr/local/bin/tojs
npm install -g tojs