2.1.1 • Published 10 years ago
url-querystring v2.1.1
url-querystring
Split an url into a qs
and url
component. Also unwraps the qs
component
by calling querystring.parse
under the hood.
Installation
npm install url-querystring
Usage
var extract = require('url-querystring');
var qs = require('querystring');
var res = extract('http://foobar.com/hello?tab=hello&method=something');
// => '{
// url: 'http://foobar.com/hello',
// qs: {
// tab: hello,
// method: something
// }
// }'
qs.parse(res.qs);
// => {tab: hello, method: something}