urler

url handler for parse and add

Usage no npm install needed!

<script type="module">
  import urler from 'https://cdn.skypack.dev/urler';
</script>

README

urler

a small lib for handle url parse and add params.

download version language License

Install

npm i urler -S

Start

parseParams

parseParams('http://a.com/b?c=1') = {c:'1'}

addParam

addParam('http://a.com/b?c=1', 'd', 2) = 'http://a.com/b?c=1&d=2'

addParams

addParams('http://a.com/b?c=1', { d: 2 }) = 'http://a.com/b?c=1&d=2'