express-request-size
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Express Request Size

npm npm type definitions Coverage Status GitHub

A middleware for Express that determines the size of each request in bytes.

Install

This package is available on npm as express-request-size. Therefore, it can be installed using the following command:

npm install express-request-size

or, if you're using yarn or pnpm:

yarn add express-request-size
pnpm install express-request-size

Usage

This middleware adds the size property to the request object.

Example usage:

const express = require('express');
const requestSize = require('express-request-size');

const app = express();
app.use(requestSize());

app.get('/', function(req, res) {
    // The request size will be available as req.size
});
// ...

This middleware also comes in with built-in types for use in Typescript:

import express from 'express';
import requestSize from 'express-request-size');

const app = express();
app.use(requestSize());

app.get('/', function(req, res) {
    // The request size will be available as req.size
});
// ...

License

MIT

Package Sidebar

Install

npm i express-request-size

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

5.94 kB

Total Files

6

Last publish

Collaborators

  • maytha8