urlparam

1.1.0 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i urlparam

Weekly Downloads

21

Version

1.1.0

License

MIT

Last publish

Collaborators

  • bunnybones1