Utility functions for adding, removing and setting values in url query strings. This is particularly suited to dealing with multi-value, '+' separated query strings.
Installation
If you don't have Yeoman installed yet, run the following.
npm install url-params
Usage
// Require url-paramsvar urlParams = ; var oldUrl = 'http://www.example.com/?foo=2+3+6&baz=6'; //// Add parameters// // Add 4 to foonewUrl = urlParams;// newUrl === 'http://www.example.com/?foo=2+3+6+4&baz=6' // Add 4 and 5 to foonewUrl = urlParams;// newUrl === 'http://www.example.com/?foo=2+3+6+4+5&baz=6' // Add a boolean valuenewUrl = urlParams;// newUrl === 'http://www.example.com/?foo=2+3+6&baz=6'newUrl = urlParams
License
MIT