question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suggest standard URLSearchParams alternative in README

See original GitHub issue

The 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:open
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
sindresorhuscommented, Feb 9, 2021

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.

2reactions
nerdymancommented, Feb 12, 2021

I recently wrote an article detailing the differences between query-string and URLSearchParams. 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/

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found