{"library":"qs-middleware","title":"Connect Querystring Middleware","description":"The `qs-middleware` package provides a Connect-compatible middleware designed for parsing URL querystrings and populating the `request.query` property. It integrates with the widely used `qs` module for robust querystring parsing, allowing users to pass configuration options directly to `qs` (e.g., `allowDots`, `arrayLimit`). Currently at version 1.0.3, the project appears to be unmaintained, with its last significant code activity dating back to 2016. Its primary function is to abstract the direct interaction with `qs` for traditional Connect and Express applications, making it straightforward to access parsed query parameters. Given its age, it primarily supports CommonJS environments and older Node.js versions, lacking native ES Module support.","language":"javascript","status":"abandoned","last_verified":"Wed Apr 22","install":{"commands":["npm install qs-middleware"],"cli":null},"imports":["const query = require('qs-middleware');","const query = require('qs-middleware');"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const http = require('http');\nconst connect = require('connect');\nconst query = require('qs-middleware');\n\nconst app = connect();\n\n// Create a simple Connect application that uses qs-middleware\n// Pass options directly to the underlying 'qs' module, e.g., allowDots\napp.use(query({ allowDots: true, depth: 5 })); \n\napp.use(function(request, response) {\n    console.log('Parsed Query:', request.query);\n    response.setHeader('Content-Type', 'application/json');\n    response.end(JSON.stringify({\n        message: 'Query parsed successfully!',\n        query: request.query,\n        example_urls: [\n            'http://localhost:3000/?name=Alice&age=30',\n            'http://localhost:3000/?user.name=Bob&items[0]=apple&items[1]=orange&foo=bar&nested[a][b][c]=d'\n        ]\n    }, null, 2));\n});\n\nconst server = http.createServer(app);\nserver.listen(3000, () => {\n    console.log('Connect app with qs-middleware running on http://localhost:3000');\n    console.log('Try visiting: http://localhost:3000/?name=Alice&age=30');\n    console.log('Or with qs options in effect: http://localhost:3000/?user.name=Bob&items[0]=apple&items[1]=orange');\n});","lang":"javascript","description":"This quickstart demonstrates how to set up `qs-middleware` with a basic Connect server to automatically parse URL querystrings into `request.query`. It shows how to pass options to the underlying `qs` module and confirms how the parsed query is accessible and returned in the HTTP response.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}