New parser: URL
See original GitHub issueA parser for URL strings would be nice. Some possible examples:
$ echo "http://example.com/test/path?q1=foo&q2=bar#frag" | jc -p --url
{
"scheme": "http",
"host": "example.com",
"path": ["test", "path"],
"query": { "q1": "foo", "q2": "bar" },
"fragment": "frag"
}
$ echo "http://john:pass@example.com" | jc -p --url
{ "scheme": "http", "host": "example.com", "user": "john", "password": "pass" }
$ echo "http://example.com:8080" | jc -p --url
{ "scheme": "http", "host": "example.com", "port": 8080 }
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:14 (11 by maintainers)
Top Results From Across the Web
Avoid "current URL string parser is deprecated" warning by ...
To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect. Doing this will cause the following error: TypeError: final ...
Read more >url-parse - npm
Small footprint URL parser that works seamlessly across Node.js and browser environments. Latest version: 1.5.10, last published: 10 months ago.
Read more >URL - Web APIs - MDN Web Docs - Mozilla
Chrome Edge
URL Full support. Chrome32. more. Toggle history Full support. Edge12. Togg...
URL() constructor Full support. Chrome19. Toggle history Full support. Edge12. footn...
createObjectURL Full...
Read more >URL | Node.js v19.3.0 Documentation
Creates a new URL object by parsing the input relative to the base . If base is passed as a string, it will...
Read more >How to Parse URL in JavaScript: hostname, pathname, query ...
How to Parse URL in JavaScript: hostname, pathname, query, hash · const url = new URL(relativeOrAbsolute [, absoluteBase]); · const url = new...
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 like that idea! I’ll look into it. Thanks for the suggestion!
This parser is now released in version 1.20.4.
BTW, this parser inspired me to also create: