urlmodule
v0.0.2
Published
URL assembler library
Downloads
8
Maintainers
Readme
urlmodule
work in progress
URLAssembler helps to assemble URLs.
See https://url.spec.whatwg.org/
Example
class GoogleUrl extends URLAssembler {
static get url() {
return 'https://www.google.com'
}
}
const url = new GoogleUrl({
pathname : 'recaptcha/api.js',
searchParams : {
render : 'explicit',
onload : `ID${ Date.now() }_onload`,
hl : document.body.lang
}
})
console.log(url)
Result:
https://www.google.com/recaptcha/api.js?render=explicit&onload=ID1536188939748_onload&hl=ru
Installation
npm install urlmodule