# random-with-percentage

> Chooses one option from listed randomly, based on percentage.

Latest version **1.0.1** (published 2019-03-25) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install random-with-percentage
pnpm add random-with-percentage
yarn add random-with-percentage
bun add random-with-percentage
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-03-25 |
| First published | 2019-03-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | neoney |
| Maintainers | neoney |

## Links

- npm: https://www.npmjs.com/package/random-with-percentage
- npm.io page: https://npm.io/package/random-with-percentage

## Recent versions

- 1.0.1 (latest) — 2019-03-25
- 1.0.0 — 2019-03-25

## README

# random-percentage

### Disclaimer: this package is in alpha. Please report any bugs to me (preferably on discord, my id is 316226442721755137)

#### How to use:

```js
const random_percentage = require("random-with-percentage");
const randomArray = [{
    "name": "10 percent chances",
    "chance": 10
},
{
    "name": "20 percent chances",
    "chance": 20 
},
{
    "name": "70 percent chances",
    "chance": 70
}]
//chances must sum up to 100
random_percentage(randomArray).then(result => console.log(result))
//"10 percent chances" OR "20 percent chances" OR "70 percent chances"

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