url utils
npm install xsm-url-utils
In node, or with browserify:
var UrlUtils = require('xsm-url-utils');
-
{Object-UrlParts} parseUrl({string})
-
{string} concatUrlParts({Object-UrlParts} urlParts)
-
{string} addTimestamp({string} url)
UrlUtils.addTimestamp('http://www.sample.com/path.html')
// return:
// "http://www.sample.com/path.html?v=1438165051488"
- {Object} parseParams({string} params)
- {Object} getParams({string} url)
- {string} getParam({string} url, {string} paramName)
UrlUtils.addTimestamp('http://www.sample.com/path.html?name=luobo&age=18', 'name')
// return:
// "luobo"
npm test