Serve a repl for a node process via a simple web console
JavaScript HTML CSS
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


If you're familiar with node.js then you're familiar with the provided REPL. You can embed a REPL in your programs and make it available via tcp or unix sockets so that you can connect to a long running node.js program and play around with it on a command line. Webrepl takes the same idea but makes the repl available via an interactive web page so that you can have all the fun of using a repl right in your web browser.

  • Node.js repl for your process in your browser
  • Tab completion is included!
  • Command history via up and down arrows
  • Webrepl also makes the properties in your context accessible via restful http calls.
  • UI inspired by
  • Optional http authentication

See a Screenshot

Requires: Node v0.8.0 or higher (for webrepl version 0.4.7+).


npm install webrepl

Or just dump all the files into your project's directory. Node module http-digest required for auth. This will be fetched by npm, but you will have to fetch it yourself if you're not using npm and want auth.


var webrepl = require('webrepl');

Then point your browser to http://localhost:8080 and have fun!

You can provide context variables just like the regular repl:

var webrepl = require('webrepl');
var foo = { 'bar': 1, 'day': new Date() };
webrepl.start(8080) = foo;

HTTP Authentication can be set (uses http digest authentication):

var webrepl = require('webrepl');
var options = { 'username': 'user', 'password': 'password' };
webrepl.start(8080, options);

Available options:

var options = {
   'username': 'username for http authentication, password must also be set',
   'password': 'password for http authentication, username must also be set',
   'hostname': 'hostname to listen on. ex: localhost,, etc'

You can also access context variables via HTTP, for example:

~ mmattozzi$ curl -i "http://localhost:8080/context/foo"
HTTP/1.1 200 OK
Content-Type: application/json
Connection: keep-alive
Transfer-Encoding: chunked


~ mmattozzi$ curl -i "http://localhost:8080/context/"
HTTP/1.1 200 OK
Content-Type: application/json
Connection: keep-alive
Transfer-Encoding: chunked


Security Note

Webrepl can be used to do all sorts of harm to the host system using the require keyword. Think twice, then a few more times before exposing webrepl to the world. Optional auth can be used to prevent unwanted access, but the connection is still insecure/unencrypted.