0.6.6 • Published 11 years ago
qs2 v0.6.6
qs2
Fork of qs that does not include array indexes when seralizing arrays.
var params = {
a: [1, 2, 3]
}
qs.stringify(params)
// => a[0]=1&a[1]=2&a[2]=3
qs2.stringify(params)
// => a[]=1&a[]=2&a[]=3node-querystring 
query string parser for node and the browser supporting nesting, as it was removed from 0.3.x, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by express, connect and others.
Installation
$ npm install qsExamples
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.comTesting
Install dev dependencies:
$ npm install -dand execute:
$ make testbrowser:
$ open test/browser/index.html0.6.6
11 years ago