{"_id":"url-set-query","_rev":"3-de2ff1c29e80f4fd6e4f91e0daf0e303","name":"url-set-query","description":"small function to append a query string to a URL","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"url-set-query","version":"1.0.0","description":"small function to append a query string to a URL","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{},"devDependencies":{"tape":"^4.0.1"},"scripts":{"test":"node test.js"},"keywords":["query","string","url","hash","querystring","qs","browser","node","queries","uri"],"repository":{"type":"git","url":"git://github.com/mattdesl/url-set-query.git"},"homepage":"https://github.com/mattdesl/url-set-query","bugs":{"url":"https://github.com/mattdesl/url-set-query/issues"},"gitHead":"26c88abaaec85fa845890ff4d8496206c713f6e3","_id":"url-set-query@1.0.0","_shasum":"016e8cfd7c20ee05cafe7795e892bd0702faa339","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.32","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"dist":{"shasum":"016e8cfd7c20ee05cafe7795e892bd0702faa339","tarball":"https://registry.npmjs.org/url-set-query/-/url-set-query-1.0.0.tgz","integrity":"sha512-3AChu4NiXquPfeckE5R5cGdiHCMWJx1dwCWOmWIL4KHAziJNOFIYJlpGFeKDvwLPHovZRCxK3cYlwzqI9Vp+Gg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDn2ixtbBDQSWlIP4kNXXfhs+W5g104DwStETgYBYqw+gIhAJstimGEb0ENWRMjKixNgoJcpS8AVeug1nxm2GEOuiw2"}]},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}]}},"readme":"# url-set-query\n\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\nSmall standalone function to set a query string on a URL, replacing the existing query and leaving the hash in place.\n\n## Example\n\n```js\nvar setQuery = require('url-set-query')\n\nsetQuery('http://foo.com/index.html?state=open', 'beep=true')\n//=> 'http://foo.com/index.html?beep=true'\n\nsetQuery('http://foo.com/some/path#about', '?foo=5&open=true')\n//=> 'http://foo.com/some/path?foo=5&open=true#about'\n\nsetQuery('http://foo.com', 'foo=5')\n//=> 'http://foo.com/?foo=5'\n\n// clears the query\nsetQuery('http://foo.com/index.html?filter=closed#about', '?')\n//=> 'http://foo.com/index.html#about'\n```\n\n## Install\n\n```sh\nnpm install url-set-query --save\n```\n\n## Usage\n\n[![NPM](https://nodei.co/npm/url-set-query.png)](https://www.npmjs.com/package/url-set-query)\n\n#### `url = setQuery(url, [query])`\n\nAppends the given `query` String onto the URL, before the hash. If a query already exists, it will be replaced. Returns the new URL.\n\nIf `query` is `'?'`, it is the same as clearing the query string from the `url`.\n\nIf `query` is an empty string or undefined, no change will be made to `url`. \n\n## See Also\n\nTo encode/decode from an object, see one of:\n\n- [querystring](https://www.npmjs.com/package/querystring)\n- [query-string](https://www.npmjs.com/package/query-string)\n- [qs](https://www.npmjs.com/package/qs)\n\n\n## License\n\nMIT, see [LICENSE.md](http://github.com/mattdesl/url-set-query/blob/master/LICENSE.md) for details.\n","maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"time":{"modified":"2022-06-28T06:20:22.376Z","created":"2015-07-25T16:30:28.465Z","1.0.0":"2015-07-25T16:30:28.465Z"},"homepage":"https://github.com/mattdesl/url-set-query","keywords":["query","string","url","hash","querystring","qs","browser","node","queries","uri"],"repository":{"type":"git","url":"git://github.com/mattdesl/url-set-query.git"},"author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"bugs":{"url":"https://github.com/mattdesl/url-set-query/issues"},"license":"MIT","readmeFilename":"README.md"}