Skip to content

shikaku/url-creator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

url-creator

###Effortless URL assembling

Examples

let url = new URLCreator('http://domain/pathname/', {foo: 'foo'});
url.toString();
// 'http://domain/pathname/?foo=foo'
url.set('pathname', '/new/pathname/');
url.toString();
// 'http://domain/new/pathname/?foo=foo'
url.setQuery('bar', 'bar');
url.toString();
// 'http://domain/new/pathname/?foo=foo&bar=bar'

API

  • constructor(urlString, queryParams)
  • get('key')
  • set('key', 'value')
  • unset('key')
  • getQuery('key')
  • setQuery('key', 'value')
  • unsetQuery('key')
  • reset()
  • toString()

Links

npm - https://www.npmjs.com/package/url-creator

About

Effortless URL assembling

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published