Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including url-polyfill with all npm packages installed. Try it out:

var urlPolyfill = require("url-polyfill")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

url-polyfill v1.1.5

Polyfill URL and URLSearchParams

Polyfill URL and URLSearchParams to match last WHATWG specifications

Compliant in most of the use cases but not at 100% (like unicode chars, punycodes, etc...)

Tested on IE 10+


npm i url-polyfill --save

Currently supported



Supported : 'hash', 'host', 'hostname', 'href', 'port', 'protocol', 'search', 'toString', 'pathname', 'origin', 'searchParams'


const url = new URL('');
  • hash: "page0"
  • host: ""
  • hostname: ""
  • href: ""
  • origin: ""
  • pathname: "/"
  • port: "8080"
  • protocol: "https:"
  • search: "?fr=yset_ie_syc_oracle&type=orcl_hpset"
  • searchParams: URLSearchParams (see next)


Supported : 'append', 'delete', 'get', 'getAll', 'has', 'set', 'forEach', 'keys', 'values', 'entries', 'toString', 'Symbol.iterator'


const url = new URL('');
url.searchParams.append('page', 0);
console.log(url.toString()); // print: ""


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free