Skip to content

srcagency/http-query-parse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

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

About

Parse and cache the query string of a http request

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published