urlgenerator
v0.7.4
Published
Simple url generation for Node JS , Express JS that works! [www.abc.xyz?def=ghi&jkl=mno]
Downloads
92
Maintainers
Readme
URL Generator for Node JS / Express JS / Javascript
A small library creating a url from base url and parameters / key value pairs
Installation
npm install urlgenerator --save
Usage - Example 1
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
Usage - Example 2
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
Tests
npm test
Contributing
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.
Release History
- 0.1.0 Initial release
- 0.2.0 Initial release
- 0.3.0 Current release