Skip to content

Natashkinsasha/query-parser-express

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

query-parser-express

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

Installation

Npm

npm install query-parser-express

Yarn

yarn add query-parser-express

Быстрый старт

const queryParser = require('query-parser-express');
const express = require('express'),

app.use(queryParser(
    {
        parseBoolean: true,  // default true
        parseNumber: true,   // default true
    }
));

// { int: '4', double: '4.5', e: '60', booleanTrue: 'true', booleanFalse: 'false', object: { int:'4' } }
console.log(req.query);
// => { int: 4, double: 4.5, e: 60, booleanTrue: true, booleanFalse: false, object: { int:4 } }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published