stringquery
v1.0.8
Published
Convert react-router-dom this.props.location.search string to an object
Downloads
4,117
Maintainers
Readme
Install
npm install stringquery --save
Usage
const querySearch = require("stringquery");
querySearch("?status=APPROVED&page=1&limit=20");
// > { limit: "10", page:"1", status:"APPROVED" }
const obj = querySearch("?status=APPROVED&page=1limit=20");
// > { limit: "10", page:"1", status:"APPROVED" }
// obj.status
// obj.page
// obj.limit
OR
import querySearch from "stringquery";
querySearch("?status=APPROVED&page=1&limit=20");
// > { limit: "10", page:"1", status:"APPROVED" }
const obj = querySearch("?status=APPROVED&page=1&limit=20");
// > { limit: "10", page:"1", status:"APPROVED" }
// obj.status
// obj.page
// obj.limit
Github: https://github.com/accimeesterlin/query-search
License
MIT