This Package Specially designed to be used in Carvia Technologies.
Install it with NPM with following command:
npm install carvia-utils
import {QueryParser} from "carvia-utils/lib/qp/QueryParser"
const qp = new QueryParser("?p=value");
const paramValue = qp.getParam("p");
console.log(`param value: ${paramValue}`);
Method Name | Description |
---|---|
constructor | Takes query string as an input (eg. '?p=value') |
getParam | To get Value of a query parameter |
addParam | To add a new param to Query String |
isEmpty | To check if there is any param exists in query string |
removeParam | To remove a param from query string |
hasParam | To check if any particular param exists in query string |
getParsedQuery | Returns a object of parsed params from query string in key value (object) format |
getQueryString | Returns a string of params. params formatted in query string format (eg. '?p=value') |