queryjs
Version:
easy url query parameter manipulation
24 lines (17 loc) • 501 B
Markdown
easy url query parameter manipulation
available in the browser and in nodejs
`npm install queryjs`
```js
//newURL === 'url.com?a=foo';
var newURL = queryjs.set('url.com', { a: 'foo' });
//newURL === 'url.com?a=new&b=bar'
newURL = queryjs.set('url.com?a=foo', { a: 'new', b: 'bar' });
```
```js
//parameters === { a: 'foo' };
var parameters = queryjs.get('url.com?a=foo');
```
works with url hashes. (todo: support query parameter arrays)