Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/derhuerst/query-string-cli
Decode & encode URL query strings in the command line.
https://github.com/derhuerst/query-string-cli
cli command-line decode encode query-string url
Last synced: 6 days ago
JSON representation
Decode & encode URL query strings in the command line.
- Host: GitHub
- URL: https://github.com/derhuerst/query-string-cli
- Owner: derhuerst
- License: isc
- Created: 2017-10-19T23:45:43.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-02-24T00:15:59.000Z (over 2 years ago)
- Last Synced: 2024-10-03T23:52:49.581Z (about 1 month ago)
- Topics: cli, command-line, decode, encode, query-string, url
- Language: JavaScript
- Homepage: https://github.com/derhuerst/query-string-cli#query-string-cli
- Size: 13.7 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# query-string-cli
**Decode & encode URL query strings in the command line.**
[![npm version](https://img.shields.io/npm/v/query-string-cli.svg)](https://www.npmjs.com/package/query-string-cli)
[![build status](https://api.travis-ci.org/derhuerst/query-string-cli.svg?branch=master)](https://travis-ci.org/derhuerst/query-string-cli)
![ISC-licensed](https://img.shields.io/github/license/derhuerst/query-string-cli.svg)
![minimum Node.js version](https://img.shields.io/node/v/query-string-cli.svg)
[![chat with me on Gitter](https://img.shields.io/badge/chat%20with%20me-on%20gitter-512e92.svg)](https://gitter.im/derhuerst)
[![support me via GitHub Sponsors](https://img.shields.io/badge/support%20me-donate-fa7664.svg)](https://github.com/sponsors/derhuerst)## Installing
```shell
npm install -g query-string-cli
```## Usage
```
Usage:
decode-query-string [--json]
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]
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 tip:* Use `query-string-cli` in conjunction with [`parse-url-cli`](https://github.com/derhuerst/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](https://github.com/derhuerst/query-string-cli/issues).