Is there such a thing as a javascript equivalent to run-python
et al available for Emacs 23 or later? I'd like to run a JS REPL from within Emacs with the standard load-definition
/load-file
bindings.
Yes. Check out js-comint.el
, which is easily installable via Marmalade or MELPA.
As @phils mentions, MozRepl is also worth a look.
Oh, this is cool. (Thanks for the question!)
I've just learned about MozRepl -- a Mozilla/Firefox extension -- via this answer to a related question, and Emacs support for MozRepl is already available.
- Install the browser extension and the Emacs library
- Start MozRepl from the browser using the Tools -> MozRepl menu
- M-x
run-mozilla
RET
Yes. Check out js-comint.el
, which is easily installable via Marmalade or MELPA.
As @phils mentions, MozRepl is also worth a look.
There's a project called skewer-mode that I've been using for this lately. For the lispers, it's basically SLIME with a browser instead of a Lisp system on the other end. It's available from MELPA and includes only Emacs libraries. Meaning, all you need to use it is Emacs and a browser.
There's also a WSH-based Javascript REPL. Really easy to run on any emacs on Windows.
http://www.emacswiki.org/emacs/JavascriptShell
- Start a Javascript "shell" in an emacs buffer. Type in Javascript and see it run.
- It allows you to define a profile, to load one or more JS modules with every shell you run. So if you want to fiddle around with json2.js, you can load it into the shell by default. You can also load in array extensions, string extensions, or whatever utility package you have.
- Includes simple command completion. If I type in
var str = "This is a string";
then try to complete (via the TAB character) onstr.
, I will get a list of all the string extension methods. The same thing works for any other type of object, even custom objects you define. - Depends on Cscript.exe, so nothing to install beyond the .el file. Obviously this means it runs on Windows only.
It's also in the Marmalade repo - http://marmalade-repo.org/packages/jsshell
© 2022 - 2024 — McMap. All rights reserved.