Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

examples

  • Loading branch information...
commit 3059db38657a5f1a68ced6500c1ea73571ce29de 1 parent d1b5a9a
@tj authored
Showing with 12 additions and 2 deletions.
  1. +9 −2 Readme.md
  2. +3 −0  examples.js
View
11 Readme.md
@@ -8,8 +8,15 @@
## Examples
- require('qs').parse('user[name][first]=tj&user[email]=tj');
- // => { user: { name: { first: 'tj' }, email: 'tj' } }
+```js
+var qs = require('qs');
+
+qs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com');
+// => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } }
+
+qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }})
+// => user[name]=Tobi&user[email]=tobi%40learnboost.com
+```
## Testing
View
3  examples.js
@@ -46,3 +46,6 @@ console.log(obj)
var obj = qs.parse('user[0]=tj&user[foo]=TJ');
console.log(obj)
+
+var str = qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }});
+console.log(str);
Please sign in to comment.
Something went wrong with that request. Please try again.