Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

urlmodule

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

urlmodule

URL assembler library

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

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)

Keywords

URL

FAQs

Package last updated on 29 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts