npm

Need private packages and team management tools?Check out npm Orgs. »

urlmodule

0.0.2 • Public • Published

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)

install

npm i urlmodule

Downloadsweekly downloads

1

version

0.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability