File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# tiny-querystring
22
3+ Tiny parsing and formatting URL query strings for Node.js and browser. (Only 430B only after gziped)
4+
5+
6+ ## Installation
7+
8+ ##### NPM
9+
10+ ``` bash
11+ npm install tiny-querystring
12+ ```
13+
14+ ##### Yarn
15+
16+ ``` bash
17+ yarn add tiny-querystring
18+ ```
19+
20+ ##### 1998 Script Tag
21+
22+ ``` html
23+ <script src =" https://unpkg.com/tiny-querystring/dist/tiny-querystring.umd.js" ></script >
24+ ```
25+
26+ ## Usage
27+
28+ ### parse(str)
29+
30+ Parses a URL query string (str) into a collection of key and value pairs.
31+
32+ ###### Example
33+
34+ ``` js
35+ import { parse } from ' tiny-querystring' ;
36+ parse (' foo=bar&abc=xyz&abc=123' );
37+ /* returns { foo: 'bar', abc: ['xyz', '123'] } */
38+ ```
39+
40+ ### stringify(obj)
41+
42+ Produces a URL query string from a given obj by iterating through the object's "own properties".
43+
44+ ###### Example
45+
46+ ``` js
47+ import { stringify } from ' tiny-querystring' ;
48+ stringify ({ foo: ' bar' , baz: [' qux' , ' quux' ], corge: ' ' });
49+
50+ /* returns 'foo=bar&baz=qux&baz=quux&corge=' */
51+ ```
52+
53+
354## License
455
556MIT
You can’t perform that action at this time.
0 commit comments