npm i is-mode
yarn add is-mode
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
import { isMode } from "is-mode";
// in server side
isMode("any-key") === false // always true
yarn outdated
yarn upgrade
yarn publish
MIT