@kszongic/url-parse-cli
v1.0.0
Published
Parse and inspect URLs from the command line — extract protocol, host, path, query params, and more
Maintainers
Readme
@kszongic/url-parse-cli
Parse and inspect URLs from the command line. Zero dependencies.
Install
npm install -g @kszongic/url-parse-cliUsage
# Full breakdown
url-parse "https://example.com:8080/path?foo=bar&baz=1#section"
# protocol: https:
# host: example.com:8080
# hostname: example.com
# port: 8080
# pathname: /path
# search: ?foo=bar&baz=1
# hash: #section
# origin: https://example.com:8080
# params:
# foo = bar
# baz = 1
# JSON output
url-parse "https://example.com/search?q=hello" --json
# Extract a single field
url-parse "https://example.com/search?q=hello" --field hostname
# example.com
# Get query params
url-parse "https://example.com?a=1&b=2" -f paramsOptions
| Flag | Description |
|------|-------------|
| -j, --json | Output as JSON |
| -f, --field <name> | Print only one field |
| -h, --help | Show help |
License
MIT © 2026 kszongic
