urlparam
v1.1.0
Published
A utility to gleam values easily from url parameters. Includes console.log reminders of possible params.
Downloads
82
Readme
urlparam
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);
License
MIT, see LICENSE.md for details.