Gathering detailed insights and metrics for search-params
Gathering detailed insights and metrics for search-params
Gathering detailed insights and metrics for search-params
Gathering detailed insights and metrics for search-params
url-search-params-polyfill
a simple polyfill for javascript URLSearchParams
@umijs/use-params
[](https://github.com/rudyhuynh/use-url-search-params/blob/master/License)
url-search-params
Simple polyfill for URLSearchParams standard
@types/url-search-params
TypeScript definitions for url-search-params
npm install search-params
Typescript
Module System
Node Version
NPM Version
TypeScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
14 Stars
40 Commits
5 Forks
2 Watchers
15 Branches
2 Contributors
Updated on Feb 07, 2024
Latest Version
4.0.1
Package Id
search-params@4.0.1
Size
11.23 kB
NPM Version
7.5.2
Node Version
14.15.4
Published on
Apr 26, 2021
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
6
A module to manipulate search part of URLs (querystring). Created to externalise some code shared by path-parser and route-node.
Parse a querystring and returns an object of parameters. See options below for available options. Optional generic type can be provided.
Build a querystring from a list of parameters. Optional generic type can be provided.
Remove a list of parameters (names) from a querystring, and returns an object containing removedParams
and querystring
.
Keep a list of parameters (names) from a querystring, and returns an object containing keptParams
and querystring
.
All options are optional.
arrayFormat
: Specifies how arrays should be stringified
'none'
(default): no brackets or indexes are added to query parameter names ('role=member&role=admin'
)'brackets
: brackets are added to query parameter names ('role[]=member&role[]=admin'
)'index'
: brackets and indexes are added to query parameter names ('role[0]=member&role[1]=admin'
)booleanFormat
: specifies how boolean values are stringified and parsed
'none'
(default): booleans are stringified to strings ('istrue=true&isfalse=false'
)'empty-true'
: same as 'none'
except true values are stringified without value ('istrue&isfalse=false'
). If you choose this boolean format, make sure to change the value of 'nullFormat'
.'string'
: same as 'none'
but 'true'
and 'false'
are parsed as booleans'unicode'
: true
and false
are displayed with unicode characters, and parsed as booleans ('istrue=✓&isfalse=✗'
)nullFormat
: specifies how null values are stringified and parsed
'default'
(default): null values are stringified without equal sign and value ('isnull'
)'string'
: null values are stringified to 'null'
('isnull=null'
) and parsed as null values'hidden'
: null values are not stringifiedFor more examples, look at the tests.
1import { parse, build, omit, keep } from 'search-params' 2 3parse('country=scotland&town=glasgow') 4// { 5// country: 'scotland', 6// town: 'glasgow' 7// } 8 9build({ 10 country: 'scotland', 11 town: 'glasgow' 12}) 13// 'country=scotland&town=glasgow' 14 15omit('country=scotland&town=glasgow', ['country ']) 16// { 17// removedParams: { 18// country: 'scotland' 19// }, 20// querystring: 'town=glasgow' 21// } 22 23keep('country=scotland&town=glasgow', ['country ']) 24// { 25// keptParams: { 26// country: 'scotland' 27// }, 28// querystring: 'country=scotland' 29// }
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
46 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More