content-length

1.0.1 • Public • Published

content-length

Express/Connect middleware to calculate the response payload size

Install

npm install content-length --save

Usage

var express = require('express');
var contentLength = require('content-length');
 
app.use(contentLength(function (err, len) {
  console.log(len);
}));
 
app.listen(3000, function () {
  
});

API

contentLength(callback)

  • callback - a callback function called when response has ended. Typical Nodejs callback style callback(err, len).

Run Tests

npm install
npm test

Package Sidebar

Install

npm i content-length

Weekly Downloads

74

Version

1.0.1

License

MIT

Last publish

Collaborators

  • scottcorgan