# babel-plugin-nondeterminism

> Add a pinch of chance to your code

Latest version **1.0.0** (published 2017-08-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-nondeterminism
pnpm add babel-plugin-nondeterminism
yarn add babel-plugin-nondeterminism
bun add babel-plugin-nondeterminism
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-08-17 |
| First published | 2017-08-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Teddy Katz |
| Maintainers | not-an-aardvark |
| Keywords | babel |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-nondeterminism
- Repository: https://github.com/not-an-aardvark/babel-plugin-nondeterminism
- Homepage: https://github.com/not-an-aardvark/babel-plugin-nondeterminism#readme
- Issues: https://github.com/not-an-aardvark/babel-plugin-nondeterminism/issues
- npm.io page: https://npm.io/package/babel-plugin-nondeterminism

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2017-08-17

## README

# babel-plugin-nondeterminism

* Do you like software that can always surpise you?

* Do you feel lonely when no one reports any bugs in your code?

* Do you wish your software wasn't so reliable?

* Do you get bored when your tests always pass?

There is a solution! `babel-plugin-nondeterminism` will modify your code to add a pinch of chance.

#### Input

```js
if (isExpired(accessToken)) {
  denyAccess();
}
```

#### Output

```js
if (isExpired(accessToken) && Math.random() < 0.999) {
  denyAccess();
}
```

### Installation

```
npm install babel-plugin-nondeterminism --save-dev
```

### Usage

Via `.babelrc`:

```json
{
  "plugins": ["nondeterminism"]
}
```

You can modify the probability to taste (default: 0.999):

```json
{
  "plugins": [["nondeterminism", { "probability": 0.75 }]]
}
```

For extra excitement, you can use a conditional `.babelrc` file to only enable the plugin when running in CI.

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