code: function () {
      return function (req, res, next) {
        var _send = res.send;
        res.send = function (body) {
          var callback = req.params.callback,
              isJSONP  = res.get('Content-Type') === 'application/json' && callback;
  
          if (body && req.method !== 'HEAD' && isJSONP) {
            res.contentType('js');
            body = callback + '(' + body.toString().trim() + ');';
          }
          _send.call(this, body);
        };
        next();
      };
    }
docs: Transparently handle JSONP. Although this does require wrapping the Request#send() method which is a bit nasty. Other alternative is to always pass the response on and include this middleware after the routes.