mw-url
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

mw-url

import getUrl from "mw-url"

//returns the window.location as string
getUrl()

//returns https://exemple.com
getUrl("https://exemple.com")

//returns the window.location with path /home
getUrl(undefined, "/home")

//returns https://exemple.com/home
getUrl("https://exemple.com", "/home")


//returns the window.location with path /home and search params
getUrl(undefined, "/home", {
    user: "admin",
    password: "1234",
})

//returns https://exemple.com/login?user=admin&password=1234
getUrl("https://exemple.com", "/login", {
    user: "admin",
    password: "1234",
})

Readme

Keywords

Package Sidebar

Install

npm i mw-url

Weekly Downloads

1

Version

1.0.2

License

ISC

Unpacked Size

1.53 kB

Total Files

4

Last publish

Collaborators

  • manuelwestermeier