Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Inject REPL into connect/express as middleware

branch: master

v0.0.4

latest commit 7fb9f94cca
Pavel Lang authored August 14, 2012
Octocat-spinner-32 lib v0.0.4 August 14, 2012
Octocat-spinner-32 .gitignore Initial commit July 11, 2012
Octocat-spinner-32 README.md REPL_EXPORT function, version 0.0.3 August 09, 2012
Octocat-spinner-32 index.js v0.0.1 July 11, 2012
Octocat-spinner-32 package.json v0.0.4 August 14, 2012
README.md

node-connect-repl

Inject REPL into connect/express as middleware.

Middleware is loaded only in environment other than production

Following is exported into REPL:

  • last_req -- last request object
  • last_res -- last response object
  • stop -- boolean. Set to true if you want "set breakpoint" in next request
  • next -- function. Call if you want to continue after stop request
  • req -- current request object when stopped
  • res -- current response object when stopped

REPL_EXPORT global function

Module exports global function REPL_EXPORT(name, value) which can be called anywhere. Provided value is accesible by name in REPL.

Example

var express = require('express');
var app = express();

// ...
app.use(require('connect-repl')());

// some routes...

app.listen(3000);
Something went wrong with that request. Please try again.