/parse-url-cli

Parse a URL, get one or all components pretty-printed or as JSON.

Primary LanguageJavaScriptISC LicenseISC

parse-url-cli

Parse a URL, get one or all components pretty-printed or as JSON. Uses whatwg-url underneath.

npm version build status ISC-licensed minimum Node.js version chat with me on Gitter support me via GitHub Sponsors

Installing

npm install -g parse-url-cli

Or use npx.

Usage

Usage:
    parse-url <url> [component]
Options:
	--json  -j  Output JSON instead of a pretty represenation.
Examples:
    parse-url 'https://example.org:2000/hello/world?foo=bar#baz' host
    parse-url --json 'example.org:2000'

Pro tip: Use query-string-cli in conjunction with parse-url-cli.

Related

Contributing

If you have a question or have difficulties using parse-url-cli, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.