Skip to content
This repository
Browse code

examples

  • Loading branch information...
commit 3059db38657a5f1a68ced6500c1ea73571ce29de 1 parent d1b5a9a
TJ Holowaychuk authored January 26, 2012

Showing 2 changed files with 12 additions and 2 deletions. Show diff stats Hide diff stats

  1. 11  Readme.md
  2. 3  examples.js
11  Readme.md
Source Rendered
@@ -8,8 +8,15 @@
8 8
 
9 9
 ## Examples
10 10
 
11  
-    require('qs').parse('user[name][first]=tj&user[email]=tj');
12  
-    // => { user: { name: { first: 'tj' }, email: 'tj' } }
  11
+```js
  12
+var qs = require('qs');
  13
+
  14
+qs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com');
  15
+// => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } }
  16
+
  17
+qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }})
  18
+// => user[name]=Tobi&user[email]=tobi%40learnboost.com
  19
+```
13 20
 
14 21
 ## Testing
15 22
 
3  examples.js
@@ -46,3 +46,6 @@ console.log(obj)
46 46
 
47 47
 var obj = qs.parse('user[0]=tj&user[foo]=TJ');
48 48
 console.log(obj)
  49
+
  50
+var str = qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }});
  51
+console.log(str);

0 notes on commit 3059db3

Please sign in to comment.
Something went wrong with that request. Please try again.