query-string-cli

1.0.1 • Public • Published

query-string-cli

Decode & encode URL query strings in the command line.

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

Installing

npm install -g query-string-cli

Usage

Usage:
    decode-query-string [--json] <encoded-query-string>
Options:
    --json       -j  Print JSON instead of an eve-friendly version.
    --delimiter  -d  Character between key/value pairs. Default: &
    --no-dots        Don't parse `a.b=foo` dot notation.
    --no-comma       Don't parse `a=foo,bar` array notation.
    --no-arrays      Don't parse `a[1]=foo` array notation.
Examples:
    decode-query-string 'foo[bar]=A&baz[0]=B&baz[1]=C'
Usage:
    encode-query-string [--no-encoding] <json>
Options:
    --no-encoding   -n  Don't URL-encode the result.
    --delimiter         Character between key/value pairs. Default: &
    --dot-notation  -d  Use the "a.b" notation for objects.
    --array-format      How to encode arrays. Default: indices
                          indices, brackets, repeat, comma
Examples:
    encode-query-string -nd '{"foo": {"bar": "A"}, "baz": ["B", "C"]}'

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

Contributing

If you have a question or have difficulties using query-string-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.

Package Sidebar

Install

npm i query-string-cli

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

6.69 kB

Total Files

5

Last publish

Collaborators

  • derhuerst