# zero-chance

> Give you a result from random calculation by decimal scoring

Latest version **0.2.0** (published 2019-08-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install zero-chance
pnpm add zero-chance
yarn add zero-chance
bun add zero-chance
```

## 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.2.0 |
| Published | 2019-08-12 |
| First published | 2019-08-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 35.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Muhibbudin Suretno |
| Maintainers | muhibbudins |
| Keywords | webpack, umd, template, es6 library, library, chance, probability |

## Links

- npm: https://www.npmjs.com/package/zero-chance
- Repository: https://github.com/muhibbudins/zero-chance
- Issues: https://github.com/muhibbudins/zero-chance/issues
- npm.io page: https://npm.io/package/zero-chance

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.2.0 (latest) — 2019-08-12
- 0.1.0 — 2019-08-12

## README

# Chance

Give you a result from random calculation by decimal scoring

## Usage

Use NPM to install **zero-chance**

```bash
$ npm install zero-chance
```

Import and create config on your project :

```js
import Chance from 'zero-chance'

const weights = [
  {
    weight: 0.001,
    title: 'Some title',
    description: 'Some description'
  },
  {
    weight: 20.40,
    title: 'Some title',
    description: 'Some description'
  },
  ... so on
]

const simple = Chance(weights)

console.log(simple) // 1 <-- result of random, given number by highest probability

/**
 * Or, you can show any detail on result with option
 */

const result = Chance(weights, {
  detail: true
})

console.log(result)
// Given result by highest probability
// {
//  index: 1,
//  weight: 0.001,
//  title: 'Some title',
//  description: 'Some description'
// } 
```

## License

This project under MIT License

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