Skip to content
This repository was archived by the owner on May 18, 2022. It is now read-only.

aristov/urlmodule

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

License

The MIT License (MIT)

About

URL assembler library

Resources

License

Stars

Watchers

Forks

Packages

No packages published