swank-js/swank-js — pull request #45 by joddie (2012-07-21 22:54:52+00:00)
Title: Add a ,require shortcut to load node.js modules with tab-completion

Hi,
I just started using swank-js to help debug a node project this week and I have a few small enhancements that maybe other people will also find useful. This is number 1 of 3. It adds a `,require` shortcut to the REPL to load modules quickly since I get tired of typing things like `http = require('http')` all the time. It does tab completion on core modules, modules in `node_modules` directories and relative file paths.

There are two tiny extra commands in `swank-handler.js` to return paths, and a few definitions in `slime-js.el`.

One useful thing that I couldn't figure out how to do is detect whether the current remote is a node process or a browser, since it's only useful on the former. But nothing bad happens if you use it on a browser instead (just complains that `require` isn't defined).