trim-body

0.0.4 • Public • Published

trim-body

Build Status

Trim parsed request body or any object with strings that needs trimming in one go.

Note: Modifies object in place.

Installation

npm install trim-body

Usage

var trimBody = require('trim-body');
 
var body = {
  name: {
    first: ' First    ',
    last: '   Last'
  },
 
  email: '  user@example.com  '
};
 
trimBody(body);
 
// body === {
//   name: {
//     first: 'First',
//     last: 'Last'
//   },
//
//   email: 'user@example.com'
// }

Tests

npm install -g mocha

Then,

npm test

License

MIT

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i trim-body

    Weekly Downloads

    32

    Version

    0.0.4

    License

    MIT

    Last publish

    Collaborators

    • samora