2.2.1 • Published 9 years ago

http-query-parse v2.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

http-query-parse

Parse and cache the query of an http request (supports nested clauses using querystringparser)

A dead-simple function you can call on an incoming request in multiple places without worrying about performance/caching and without any prior parsing of the request/url.

If you like the style, check out http-body-parse and http-get-pathname

Uses results cached in _parsedUrl if available which works great with for instance parseurl.

Installation

npm install http-query-parse

Usage

The result is cached and subsequent calls are cheap

var httpQueryParse = require('http-query-parse');

// http://localhost/path?name=brian&age[month]=5&age[year]=1991

httpQueryParse(request); // { name: 'brian', age: { month: '5', year: '1991' } }

// second call is cheap
httpQueryParse(request); // { name: 'brian', age: { month: '5', year: '1991' } }

License

MIT © src.agency

2.2.1

9 years ago

2.2.0

10 years ago

2.1.0

10 years ago

2.0.0

10 years ago