alisonmonteiro / get-url-generator

Objects :point_right: GET parameters
2 stars 0 forks source link
params

get-url-generator

Install

$ npm install get-url-generator --save

Usage

const generateUrl = require('get-url-generator');

generateUrl('http://google.com', {
  q: 'generate url',
  true: 'true',
  test: 'ava'
});
//=> http://google.com?q=generate+url&true=true&test=ava

generateUrl('google.com/search', { q: 'test' });
//=> google.com/search?q=test

generateUrl('http://google.com');
//=> http://google.com