A small library creating a url from base url and parameters / key value pairs
npm install urlgenerator --save
var urlgenerator = require('urlgenerator');
var createURLwithParameters = urlgenerator.createURLwithParameters;
var baseURL = "www.google.com";
var parameters = {};
parameters.mobile = '7838185123';
parameters.shit = 'xxx';
var finalURL = createURLwithParameters(baseURL,parameters);
console.log("final URL is " , finalURL);
prints - final URL is www.google.com?mobile=7838185123&shit=xxx
var urlgenerator = require('urlgenerator');
var createURLwithParameters = urlgenerator.createURLwithParameters;
var baseURL = "www.google.com";
var parameters = { 'mobile' : '7838185123',
'shit' : 'xxx' };
var finalURL = createURLwithParameters(baseURL,parameters);
console.log("final URL is " , finalURL);
prints - final URL is www.google.com?mobile=7838185123&shit=xxx
npm test
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.
- 0.1.0 Initial release
- 0.2.0 Initial release
- 0.3.0 Current release