The query string module provides utilities for dealing with query strings.
$ component install anchorjs/querystring
$ volo add anchorjs/querystring
Serialize an object to a query string. Optionally override the default separator ('&') and assignment ('=') characters.
querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' })
// returns
'foo=bar&baz=qux&baz=quux&corge='
querystring.stringify({foo: 'bar', baz: 'qux'}, ';', ':')
// returns
'foo:bar;baz:qux'
Deserialize a query string to an object. Optionally override the default separator ('&') and assignment ('=') characters.
querystring.parse('foo=bar&baz=qux&baz=quux&corge')
// returns
{ foo: 'bar', baz: ['qux', 'quux'], corge: '' }
This module uses the AMD format. To include in component builds, use component-amd:
component build -u component-amd
This module implements the interface exported by Node's Query String module.
To run tests in a browser, execute the Make target for the desired browser:
$ make test-chrome
$ make test-firefox
$ make test-safari
Headless tests can be executed directly from a terminal:
$ make test-phantomjs
Copyright (c) 2012-2013 Jared Hanson <http://jaredhanson.net/>
Copyright Joyent, Inc. and other Node contributors.