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

connect-trim-body

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect-trim-body

Connect/Express middleware to trim all parameters in request body. Works recursively.

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

connect-trim-body

Connect/Express middleware to trim parameters in request body. Works recursively.

Dependencies

Requires body-parser middleware.

Usage

var express = require('express')
  , bodyParser = require('body-parser')
  , trimBody = require('connect-trim-body')
  ;

var app = express();

app.use(bodyParser()); // body-parser first
app.use(trimBody());

app.post('/products', function (req, res) {
  res.json(req.body);
});

app.listen(3000);
{
  "brand": "HP",
  "model": "EliteBook",
  "description": "   some stuff    "
}

// becomes

{
  "brand": "HP",
  "model": "EliteBook",
  "description": "some stuff"
}

License

MIT

Keywords

FAQs

Package last updated on 04 Jun 2014

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