https://github.com/cap32/tiny-querystring
Tiny parsing and formatting URL query strings for Node.js and browser (309B only)
https://github.com/cap32/tiny-querystring
browser mini nodejs qs query querystring querystrings stringify tiny
Last synced: 12 days ago
JSON representation
Tiny parsing and formatting URL query strings for Node.js and browser (309B only)
- Host: GitHub
- URL: https://github.com/cap32/tiny-querystring
- Owner: Cap32
- License: mit
- Created: 2017-09-08T18:09:22.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-27T17:25:26.000Z (about 7 years ago)
- Last Synced: 2025-04-22T12:12:20.462Z (12 days ago)
- Topics: browser, mini, nodejs, qs, query, querystring, querystrings, stringify, tiny
- Language: JavaScript
- Homepage:
- Size: 57.6 KB
- Stars: 22
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# tiny-querystring
[](https://travis-ci.org/Cap32/tiny-querystring) [](https://coveralls.io/github/Cap32/tiny-querystring?branch=master) [](https://github.com/Cap32/tiny-querystring/blob/master/LICENSE.md)
Tiny parsing and formatting URL query strings for Node.js and browser. (309B only)
## Installation
##### NPM
```bash
npm install tiny-querystring
```##### Yarn
```bash
yarn add tiny-querystring
```##### 1998 Script Tag
```html
```
## Usage
### parse(str)
Parses a URL query string (str) into a collection of key and value pairs.
###### Example
```js
import { parse } from 'tiny-querystring';
parse('foo=bar&abc=xyz&abc=123');/* returns { foo: 'bar', abc: ['xyz', '123'] } */
```### stringify(obj)
Produces a URL query string from a given obj by iterating through the object's "own properties".
###### Example
```js
import { stringify } from 'tiny-querystring';
stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' });/* returns 'foo=bar&baz=qux&baz=quux&corge=' */
```## Contributing
Contributions welcome! See the [Contributing Guide](/CONTRIBUTING.md)
## License
MIT