This is just a mode built on top of skewer-mode to emulate the functionality of browser-based HTML/JS/CSS editors who automatically evaluate code on every change.
Whereas skewer allows you to evaluate the buffer or individual forms with commands/key-bindings, this just f'ing does it for you. What could be angrier than that?
However, code is not evaluated every single time the buffer changes. Here's
what happens whenever Emacs runs its
- First, livid-mode can be paused. If it has been, nothing happens.
- Then, the trimmed contents are compared to the previously evaluated contents. If they're the same, nothing happens.
- Next, syntax is checked by the external
jscommand. If there is any SyntaxError, nothing happens. (You can override this behavior if you want via
- Finally, skewer sends the buffer's code to be evaluated in the browser, asynchronously. (This is presumably all about the side effects, so return values disappear into the ether.)
It's in marmalade, called
Clone the repo, stick it in .emacs.d or wherever, and
Just do M-x livid-mode on any js2-mode buffer. The mode will initiate skewer-mode if it is not present, but assumes you already have the simple-httpd server running.
At that point, have a web browser loaded to a page with this script tag present (adjusted to correspond with the host/port you're using), as per usual with skewer:
Public domain, like skewer-mode.