url2
An implementing of Node.js Url, common for Browser and Node.js env.
Install
$ npm install url-browser
Usage
// Create query object from query str like '?query=string'url2;// => {"a":{"b":"1","c":"2"},"d":["3","4",{"c":{"e":"5"}}]} // In traditional modeurl2traditional = true;url2;// => {"a":["1","2","3"]} // Add new queries and merge existed queriesurl2;// => ?a=2&b=3 // Use jQuery.param's source code, doc at http://api.jquery.com/jQuery.param/var myObject = a: one: 1 two: 2 three: 3 b: 1 2 3 ;url2;// => a%5Bone%5D=1&a%5Btwo%5D=2&a%5Bthree%5D=3&b%5B%5D=1&b%5B%5D=2&b%5B%5D=3;// => a[one]=1&a[two]=2&a[three]=3&b[]=1&b[]=2&b[]=3
Go url for thoes: url2.parse, url2.format, url2.normalize, url2.resolve