(Translated by https://www.hiragana.jp/)
GitHub - Himenon/is-mode: Provides branching using query parameters.
Skip to content

Himenon/is-mode

Repository files navigation

is-mode

Install

npm i is-mode
yarn add is-mode

Usage

If Browser

import { isMode } from "is-mode";

// http://localhost?mode=abc
isMode("abc") === true // true

Change check params

import { isMode, setup } from "is-mode";

setup({
  modeKey: "newMode"
})

// http://localhost?newMode=abc
isMode("abc") === true // true

If Server Side

import { isMode } from "is-mode";

// in server side
isMode("any-key") === false // always true

Update

yarn outdated
yarn upgrade

Publish

yarn publish

Badges

npm version Build Status codecov dependencies Status devDependencies Status code style: prettier

License

MIT