Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

limits

Package Overview
Dependencies
Maintainers
5
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

limits

Sets the limit to upload size and processing time for incoming and outgoing requests.

  • 0.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
927
decreased by-22.62%
Maintainers
5
Weekly downloads
 
Created
Source

limits

Simple express/connect middleware to set limit to upload size, set request timeout etc.

It is responsible for:

  • Preventing upload completely. In config, use: { file_uploads: false }

  • Limiting the total size of upload In config, use: { post_max_size: [bytes] }, if 0, this functionality is disabled

  • Limiting the length of uri In config, use: { uri_max_length: [number] }, if 0 this functionality is disabled

  • Setting a global absolute timeout for both incoming and outgoing connections In config, use: { global_timeout: [millis] }, if 0 - no timeout is set

  • Setting a global absolute timeout for incoming connections only In config, use: { inc_req_timeout: [millis] }, if 0 - no timeout is set

  • Setting a global absolute timeout for outgoing connections only In config, use: { out_req_timeout: [millis] }, if 0 - no timeout is set

  • Setting idle timeout for incoming connections In config, use: { idle_timeout: [millis] }, if 0 - no timeout is set

  • Setting the http.Agent.defaultMaxSockets for the entire app In config, use: { max_sockets: [number] }, if 0 - nothing will be set.

  • Setting the socket noDelay In config, use: { socket_no_delay: [boolean] }, if false - nothing will be set.

To completely disable module use config, { enable: false }. Each of the above functionality is disabled if corresponding config attribute is not set.

install

With npm do:

npm install limits

usage

var express = require('express'),
    limits = require('limits');

var app = express();

var limits_config = {
    enable: true,
    file_uploads: true,
    post_max_size: 2000000
}

app.use(limits(limits_config));

app.listen(8000);

Build Status

Build Status

Node Badge

NPM

FAQs

Package last updated on 10 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc