connect-callback
A middleware for Connect and Express that allows sending data to a response stream using the callback API.
It extends the http response object to contain a callback()
function which can be invoked directly using the conventional callback API with an (err, result)
tuple. The error is transformed to an error HTTP code either by reading the error's .http_code
attribute if it exists, or by reverse-lookup in the http.STATUS_CODES
dictionary based o nthe error's .name
attribute.
Installation
$ npm install connect-callback
Usage Examples
var connect = callback = ; ; // ValidationError class { Error; thisname = argumentscalleename; // "ValidationError"};ValidationErrorprototype = Errorprototype;