New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

express-query-auto-parse

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

express-query-auto-parse

Convert query strings to numbers and booleans for express/connect applications.

latest
Source
npmnpm
Version
3.0.1
Version published
Maintainers
1
Created
Source

express-query-auto-parse

Convert query strings to boolean, numbers and dates for express/connect applications.

npm Build Status

Installation

npm install --save express-query-boolean

Getting Started

The module will recursively attempt to parse every property in req.query.

Load it right after bodyParser:

var autoParser = require('express-query-auto-parse');

// [...]

app.use(bodyParser.json());
app.use(autoParser());

Without

// ?a=true&b[c]=false
console.log(req.query);
// => { a: 'true', b: { c: 'false' } }

With

// ?a=true&b[c]=false
console.log(req.query);
// => { a: true, b: { c: false } }

Numbers

Convert string to numbers if they can be converted.

// ?a=2a&b=2
console.log(req.query);
// => { a: '2a', b: 2 }

Dates ( New in v2.2.0 )

Convert string to dates if they are valid dates.

// ?a=2a&b=2020-03-17T23:05:53.733Z
console.log(req.query);
// => { a: '2a', b: 2020-03-17T23:05:53.733Z }

Change logs

v3.0.1

  • FIX - Documentation

v3.0.0

  • Added support for date conversion.
  • FIX - Vulns and outdatet packages.
  • FIX - Travis integration shows wrong build.
  • FIX - NPM tag show wrong info.
  • README updated

Forked from

Copyright (c) 2015 Marius Craciunoiu. Licensed under the MIT license.

Keywords

express

FAQs

Package last updated on 18 Mar 2020

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