express-bandwidth

Express bandwidth middleware

Usage no npm install needed!

<script type="module">
  import expressBandwidth from 'https://cdn.skypack.dev/express-bandwidth';
</script>

README

express-bandwidth

Build Status

Express middleware to monitor the bandwidth of requests.

Limitations:

  1. If you use a reverse proxy that does compression / TLS termination, the bandwidth will not reflect that.
  2. The bandwidth figure doesn't currently include HTTP headers, only request/response body.

Install

npm install --save express-bandwidth express-transform

Usage

import transform from 'express-transform';
import bandwidth from 'express-bandwidth';

app.use(transform());

app.use(bandwidth((bw) => {
  console.log(bw.incoming);
  console.log(bw.outgoing);
}));