Skip to content

mariusc23/express-query-boolean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

express-query-boolean

Convert query strings to 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 boolParser = require('express-query-boolean');

// [...]

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

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 } }

License

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

About

Parse booleans in req.query for express/connect applications.

Resources

License

Stars

Watchers

Forks

Packages

No packages published