https://github.com/himenon/is-mode
Provides branching using query parameters.
https://github.com/himenon/is-mode
frontend queryparams
Last synced: 3 months ago
JSON representation
Provides branching using query parameters.
- Host: GitHub
- URL: https://github.com/himenon/is-mode
- Owner: Himenon
- License: mit
- Created: 2019-03-16T09:02:03.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-07-04T06:32:10.000Z (over 5 years ago)
- Last Synced: 2025-02-15T19:35:24.298Z (10 months ago)
- Topics: frontend, queryparams
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/is-mode
- Size: 108 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# is-mode
## Install
```sh
npm i is-mode
```
```sh
yarn add is-mode
```
## Usage
### If Browser
```ts
import { isMode } from "is-mode";
// http://localhost?mode=abc
isMode("abc") === true // true
```
Change check params
```ts
import { isMode, setup } from "is-mode";
setup({
modeKey: "newMode"
})
// http://localhost?newMode=abc
isMode("abc") === true // true
```
### If Server Side
```ts
import { isMode } from "is-mode";
// in server side
isMode("any-key") === false // always true
```
## Update
```sh
yarn outdated
yarn upgrade
```
## Publish
```
yarn publish
```
## Badges
[](https://npm.im/is-mode)
[](https://travis-ci.com/Himenon/is-mode)
[](https://codecov.io/gh/Himenon/is-mode)
[](https://david-dm.org/Himenon/is-mode)
[](https://david-dm.org/Himenon/is-mode?type=dev)
[](https://github.com/prettier/prettier)
## License
MIT