Suggest standard URLSearchParams alternative in README
See original GitHub issueThe URL standard includes the URLSearchParams
interface which in many cases should be able to replace this module. I think it should be suggested as an alternative.
> String(new URLSearchParams({a: 1, b: 2}))
'a=1&b=2'
> Object.fromEntries(new URLSearchParams('a=1&b=2'))
{ a: '1', b: '2' }
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (1 by maintainers)
Top Results From Across the Web
URL Standard
The URL Standard defines URLs, domains, IP addresses, the application/x-www-form-urlencoded format, and their API.
Read more >Untitled
stream Type: `boolean`<br> Default: `false` Returns a `Stream` instead of a `Promise`. This is equivalent to calling `got.stream(url, [options])`.
Read more >How to get parameter value from query string? - Stack Overflow
Note, that searchParams is an instance of URLSearchParams, which also implements ... Then, it would need to add a way for other users...
Read more >keywords:urlsearchparams - npm search
The URLQueryParams class defines utility methods to work with the query string of a URL. It is a good replacement for standard URLSearchParams...
Read more >node-fetch-h2 | Yarn - Package Manager
node-fetch. npm version build status coverage status install size. A light-weight module that brings window.fetch to Node.js.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I agree. I’ve been thinking about this. I don’t think it’s useful to just link to it though. We should explain in detail how it differs and their trade-offs.
I recently wrote an article detailing the differences between
query-string
andURLSearchParams
. Not sure if it’s in-depth enough but it might be useful?https://dev.to/nerdyman/replacing-query-string-with-native-urlsearchparams-4kdg
Edit: There’s also a CodeSandbox demo https://tflmb.csb.app/