Framework

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

# Kanso API Documentation

Index | View on single page

## url

URL 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.

### parse(url, [parseQueryString, slashesDenoteHost])

Take a URL string, and return an object. Pass true as the second argument to also parse the query string using the querystring module.

#### Parameters

url | String |
parseQueryString | Boolean |
slashesDenoteHost | Boolean |

Returns: Object

### format(obj)

Take a parsed URL object, and return a formatted URL string.

#### Parameters

obj | Object |

### resolve(source, relative)

Take a base URL, and a href URL, and resolve them as a browser would for an anchor tag.

#### Parameters

source | String |
relative | String |

Returns: String