npm.io
0.1.5 • Published 11 years ago

serialize-for-xhr

Licence
ISC
Version
0.1.5
Deps
0
Vulns
0
Weekly
0

What Does It Do?

A fast and simple way to encode a javascript object into a string that can be used for POST/GET params for xhr2 requests.

How To Use

npm i serialize-for-xhr --save
var serialize = require('serialize-for-xhr')

console.log(serialize({foo: "hi there", bar: { blah: 123, quux: [1, 2, 3] }}));
// foo=hi%20there&bar%5Bblah%5D=123&bar%5Bquux%5D%5B0%5D=1&bar%5Bquux%5D%5B1%5D=2&bar%5Bquux%5D%5B2%5D=3

Keywords