Framework

- About
- Guides
- Community
- API
- Code
- Download

# Kanso API Documentation

Index | View on single page

## querystring

Querystring functions ported from node.js to work in CouchDB and the browser. This module is used internally by Kanso, although you can use it in your apps too if you find the functions useful.

### unescape(str)

Decodes a URI Component, provided so that it could be overridden if necessary.

#### Parameters

str | String |

Returns: String

### escape(str)

Encodes a URI Component, provided so that it could be overridden if necessary.

#### Parameters

str | String |

Returns: String

### stringify(obj, [sep, eq, name])

Serialize an object to a query string. Optionally override the default separator and assignment characters.

Example:

    querystring.stringify({foo: 'bar'})
    // returns
    'foo=bar'

    querystring.stringify({foo: 'bar', baz: 'bob'}, ';', ':')
    // returns
    'foo:bar;baz:bob'

#### Parameters

obj | Object |
sep | String |
eq | String |
name | String |

Returns: String

### decode(qs, [sep, eq])

Deserialize a query string to an object. Optionally override the default separator and assignment characters.

Example:

    querystring.parse('a=b&b=c')
    // returns
    // { a: 'b', b: 'c' }

#### Parameters

qs | String |
sep | String |
eq | String |

Returns: Object