Gathering detailed insights and metrics for @scaleway/use-query-params
Gathering detailed insights and metrics for @scaleway/use-query-params
npm install @scaleway/use-query-params
Typescript
Module System
Min. Node Version
Node Version
NPM Version
@scaleway/eslint-config-react@5.2.6
Published on 03 Feb 2025
@scaleway/use-segment@1.1.10
Published on 27 Jan 2025
@scaleway/eslint-config-react@5.2.5
Published on 27 Jan 2025
@scaleway/cookie-consent@2.0.9
Published on 27 Jan 2025
@scaleway/use-query-params@5.0.13
Published on 27 Jan 2025
@scaleway/validate-icu-locales@3.1.10
Published on 27 Jan 2025
TypeScript (90.43%)
JavaScript (9.2%)
Python (0.37%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
486,218
Last Day
510
Last Week
1,424
Last Month
6,404
Last Year
102,232
27 Stars
2,817 Commits
9 Forks
12 Watching
32 Branches
42 Contributors
Minified
Minified + Gzipped
Latest Version
5.0.12
Package Id
@scaleway/use-query-params@5.0.12
Unpacked Size
8.39 kB
Size
2.92 kB
File Count
5
NPM Version
10.8.2
Node Version
20.18.1
Publised On
30 Dec 2024
Cumulative downloads
Total Downloads
Last day
104.8%
510
Compared to previous day
Last week
1%
1,424
Compared to previous week
Last month
-33.2%
6,404
Compared to previous month
Last year
-55.7%
102,232
Compared to previous year
2
3
3
@scaleway/use-query-params
1$ pnpm add @scaleway/use-query-params react-router-dom
1import React from 'react' 2import { render } from 'react-dom' 3import { BrowserRouter as Router } from 'react-router-dom' 4import useQueryParams from '@scaleway/use-query-params' 5 6const App = () => { 7 const { queryParams, setQueryParams } = useQueryParams() 8 const { user } = queryParams 9 const setUser = () => setQueryParams({ user: 'John' }) 10 // ?user=John 11 12 return ( 13 <> 14 <h1>User: {user}</h1> 15 <button onClick={setUser}>Set User John</button> 16 </> 17 ) 18} 19 20render( 21 <Router> 22 <App /> 23 </Router>, 24 document.getElementById('react-root'), 25)
Merge current query params with the new ones passed in parameters.
1// In this exemple we assume that we have an URL that include : `?company=Scaleway". 2import React from 'react' 3import useQueryParams from '@scaleway/use-query-params' 4 5const Component = () => { 6 const { queryParams, setQueryParams } = useQueryParams() 7 const { user, company } = queryParams // user will be undefined and company will be "Scaleway" 8 const setUser = () => setQueryParams({ user: 'John' }) // user will be "John" and company will be "Scaleway" 9 // ?company=Scaleway&user=John 10 11 return ( 12 <> 13 <h1>User: {user}</h1> 14 <h1>Company: {company}</h1> 15 <button onClick={setUser}>Set User John</button> 16 </> 17 ) 18}
Erase current query params and replace by the new ones passed in parameters.
1// In this exemple we assume that we have an URL that include : `?company=Scaleway". 2import React from 'react' 3import useQueryParams from '@scaleway/use-query-params' 4 5const Component = () => { 6 const { queryParams, replaceQueryParams } = useQueryParams() 7 const { user, company } = queryParams // user will be undefined and company will be "Scaleway" 8 const setUser = () => replaceQueryParams({ user: 'John' }) // user will be "John" and company will be undefined 9 // ?user=John 10 11 return ( 12 <> 13 <h1>User: {user}</h1> 14 <h1>Company: {company}</h1> 15 <button onClick={setUser}>Set User John</button> 16 </> 17 ) 18}
To avoid mutating history
1// In this exemple we assume that we have an URL that include : `?company=Scaleway". 2import React from 'react' 3import useQueryParams from '@scaleway/use-query-params' 4 5const Component = () => { 6 const { queryParams, replaceQueryParams } = useQueryParams() 7 const { user, company } = queryParams // user will be undefined and company will be "Scaleway" 8 const setUser = () => replaceQueryParams({ user: 'John' }, { push: true }) // user will be "John" and company will be undefined 9 // ?user=John 10 11 return ( 12 <> 13 <h1>User: {user}</h1> 14 <h1>Company: {company}</h1> 15 <button onClick={setUser}>Set User John</button> 16 </> 17 ) 18}
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
2 existing vulnerabilities detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-01-27
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