Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

url-search

jxv10643MIT1.1.4

An address bar parameter managerment plugin.

router, href, location, history, url, query, params, url-params, url-search

readme

url-search

An address bar parameter managerment plugin.

Usage

const URLSearch = require('url-search');
const url = new URLSearch();

url.push('type', 1); // '?type=1'
url.push('keyword', 'hello'); // '?type=1&keyword=hello'

url.remove('type'); // '?keyword=hello'
url.remove('keyword'); // ''

url.data.type = 1;
url.data.keyword = 'hello';
url.update();
// '?type=1&keyword=hello'

Methods

const URLSearch = require('url-search');
URLSearch.prototype.push || function
URLSearch.prototype.remove || function
URLSearch.prototype.update || function
URLSearch.parse || function