urlparam

A utility to gleam values easily from url parameters. Includes console.log reminders of possible params.

Usage no npm install needed!

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

README

urlparam

experimental

A utility to gleam values easily from url parameters. Includes console.log reminders of possible params.

Usage

Construct URLs with parameters like this: localhost:9966/?testString=hi&testNum=9001&testBool=false

    var urlparam = require('urlparam');
    var param = urlparam('testNum', 10);
    // if testNum wasn't in the URL, 10 will be the used instead.

You can also quickly disable URLParams

    var urlparam = require('urlparam');
    urlparam.active = false;
    // For subsequent urlparam calls, testNum will be 10 despite what is in the URL
    var param = urlparam('testNum', 10);

NPM

License

MIT, see LICENSE.md for details.