Skip to content

Instantly share code, notes, and snippets.

@brapse
Created December 1, 2010 16:06
Show Gist options
  • Save brapse/723696 to your computer and use it in GitHub Desktop.
Save brapse/723696 to your computer and use it in GitHub Desktop.
// A repl library that you can include in your own code to get a runtime
// interface to your program.
//
// var repl = require("/repl.js");
// repl.start("prompt> "); // start repl on stdin
// net.createServer(function (socket) { // listen for unix socket connections and start repl on them
// repl.start("node via Unix socket> ", socket);
// }).listen("/tmp/node-repl-sock");
// net.createServer(function (socket) { // listen for TCP socket connections and start repl on them
// repl.start("node via TCP socket> ", socket);
// }).listen(5001);
// repl.start("node > ").context.foo = "stdin is fun"; // expose foo to repl context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment