Por que esses geeks clojure e lisp têm toda a diversão?
Usando js-comint e node, você pode facilmente codificar ao vivo seu código de nó, enviando uma expressão ou região por vez para ser executada em um REPL do Emacs.
Para o TLDR, verifique http://twitter.com/emacs/status/13134393723 e corrija o comando do nó, mas é muito simples:
Primeiro, instale js-comint . Usar el-get é tão simples quanto
el-get-install js-comint</code></pre>
Then, instead of the code in that tweet, add the following to your emacs init file:
(require 'js-comint)
(setq inferior-js-program-command "node") ;; not "node-repl"
;; Use your favorited js mode here:
(add-hook 'js3-mode-hook '(lambda ()
(local-set-key "C-xC-e"
'js-send-last-sexp)
(local-set-key "C-M-x"
'js-send-last-sexp-and-go)
(local-set-key "C-cb"
'js-send-buffer)
(local-set-key "C-cC-b"
'js-send-buffer-and-go)
(local-set-key "C-cl"
'js-load-file-and-go)
))
</code>
</pre>
</p>
You don't have to, but you can manually start the REPL with M-x run-js
Then you're set. Just open a node file and start coding. As you go, you can send code to the REPL and see how it works.
This is especially useful for working with APIs, less-than-well-documented plugins and other black boxes where you need to poke around a bit to figure out how things work.