# flipflag

> cli flags with aliases, from argv, env, globals, --env.flags, callbacks, preserves casing

Latest version **0.0.6** (published 2017-04-03) · 0 weekly downloads

## Install

```sh
npm install flipflag
pnpm add flipflag
yarn add flipflag
bun add flipflag
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2017-04-03 |
| First published | 2017-03-18 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 7.7.2 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | James |
| Maintainers | aretecode |
| Keywords | cli, flags, argv, env, globals |

## Links

- npm: https://www.npmjs.com/package/flipflag
- Repository: https://github.com/flip-box/fliphub
- Homepage: https://github.com/flip-box/fliphub#readme
- Issues: https://github.com/flip-box/fliphub/issues
- npm.io page: https://npm.io/package/flipflag

## Dependencies (3)

- [izz](https://npm.io/package/izz.md) *
- [fliptime](https://npm.io/package/fliptime.md) *
- [minimalist](https://npm.io/package/minimalist.md) ^1.0.0

## Alternatives

- [replicas-cli](https://npm.io/package/replicas-cli.md) — 3.0K weekly downloads
- [env-contract](https://npm.io/package/env-contract.md) — 133 weekly downloads
- [@openveo/api](https://npm.io/package/@openveo/api.md) — 61 weekly downloads
- [@ryniaubenpm2/cumque-error-reiciendis](https://npm.io/package/@ryniaubenpm2/cumque-error-reiciendis.md) — 54 weekly downloads
- [ts-global-type-extra](https://npm.io/package/ts-global-type-extra.md) — 11 weekly downloads

## Recent versions

- 0.0.6 (latest) — 2017-04-03
- 0.0.4 — 2017-03-23
- 0.0.1 — 2017-03-18

## README

# 🙃 🚩 flipflag

[![NPM version][flipflag-npm-image]][flipflag-npm-url]
[![MIT License][license-image]][license-url]
[![fliphub][gitter-badge]][gitter-url]
[![flipfam][flipfam-image]][flipfam-url]

[flipflag-npm-image]: https://img.shields.io/npm/v/flipflag.svg
[flipflag-npm-url]: https://npmjs.org/package/flipflag
[license-image]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat
[license-url]: https://spdx.org/licenses/MIT
[gitter-badge]: https://img.shields.io/gitter/room/fliphub/pink.svg
[gitter-url]: https://gitter.im/fliphub/Lobby
[flipfam-image]: https://img.shields.io/badge/%F0%9F%8F%97%20%F0%9F%92%A0-flipfam-9659F7.svg
[flipfam-url]: https://www.npmjs.com/package/flipfam


> cli flags with aliases, from argv, env, globals, --env.flags, callbacks, preserves casing and searches original case, uppercase, lowercase

## 📦 usage
```bash
yarn add flipflag
npm i flipflag --save
```

```js
const flags = require('flipflag')
```


# 📘 examples

## easy

```js
const envs = flags('--env')
const nullVal = flags('nonExistantForAllCases')
```


## aliases, callbacks

```js
const names = [
  'cache',

  // last one is the key
  'o,operations,ops',
]

const flags = [{
  names,
  cb: ({ops, cache}) => {

  },
}]

flipflag.findAll(flags)
```

## defaults & types

```js
const apps = flags('apps', {type: 'arr', default: false})
```

## exports

```js
const {
  aliased,
  addAliases,
  parseAliases,
  findAndDecorate,
  decorate,
  findAll,
  searchAll,
  val,
  get,
  argv,
  minimist,
} = require('flipflag')
```


## ⚡ perf

takes ~1ms to search for process.env flags, 60 microseconds searching argv, 40 microseconds to search globals. see test/examples for more.

---
_Source: https://npm.io/package/flipflag · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
