@kszongic/url-encode-cli
v1.0.0
Published
URL encode and decode strings from the command line — zero dependencies
Maintainers
Readme
@kszongic/url-encode-cli
URL encode and decode strings from the command line — zero dependencies.
Install
npm i -g @kszongic/url-encode-cliUsage
# Encode (default: encodeURIComponent)
url-encode "hello world"
# → hello%20world
# Decode
url-encode -d "hello%20world"
# → hello world
# URI mode (preserves :// and other structural chars)
url-encode -u "https://example.com/path with spaces"
# → https://example.com/path%20with%20spaces
# Pipe from stdin
echo "foo=bar baz" | url-encode
# → foo%3Dbar%20bazOptions
| Flag | Description |
|------|-------------|
| -d, --decode | Decode instead of encode |
| -c, --component | Use encodeURIComponent / decodeURIComponent (default) |
| -u, --uri | Use encodeURI / decodeURI |
| -h, --help | Show help |
| -v, --version | Show version |
License
MIT © kszongic
