fastify-qs
v5.0.0
Published
Fastify plugin for querystring parsing with qs
Downloads
19,803
Readme
fastify-qs
A plugin for Fastify that adds support for parsing URL query parameters with qs.
Plugin accepts any options from qs.parse method
This plugin removes all unnecessary ? from the beginning of the query string.
This behavior can be disabled with disablePrefixTrim option.
Install
npm i fastify-qs
Plugin specific options
disabled
: set true if you want to disable qs parsingdisablePrefixTrim
: set true if you want to disable
Example
const fastify = require('fastify')()
fastify.register(require('fastify-qs'), {})
fastify.get('/*', (req, reply) => {
req.query // -> { a: ['1', '2'] }
reply.send('')
})
// GET: 'http://127.0.0.1/?a[]=1&a[]=2