# raffle-x

> Raffle package.

Latest version **1.0.2** (published 2019-12-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install raffle-x
pnpm add raffle-x
yarn add raffle-x
bun add raffle-x
```

## 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.2 |
| Published | 2019-12-14 |
| First published | 2019-12-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Rafael Campos Gonçalves |
| Maintainers | r.goncalves |
| Keywords | raffle, sorteio, rifa |

## Links

- npm: https://www.npmjs.com/package/raffle-x
- Repository: https://github.com/Rafaelcamposgoncalves/raffle-x
- Homepage: https://github.com/Rafaelcamposgoncalves/raffle-x#readme
- Issues: https://github.com/Rafaelcamposgoncalves/raffle-x/issues
- npm.io page: https://npm.io/package/raffle-x

## Recent versions

- 1.0.2 (latest) — 2019-12-14
- 1.0.1 — 2019-12-14
- 1.0.0 — 2019-12-14

## README

# raflle-x
  
Raffle package.
   
### Importing  
```javascript
const raffleX = require('raffle-x');
```  
  
### Parameters  
(array, key, quantity, false)

| PARAMETER  | VALUE           | OBS                                           |
|------------|-----------------|-----------------------------------------------|
| array      | JSON array      | JSON array with values ​​to be raffles          |
| key        | array key       | Key of the field to be located                |
| quantity   | quantity number | Number of names raffles                       |
| duplicity  | true/false      | If the same die can be raffles more than once |
  

### Usage example 

```javascript
const names = [
    {
        "id": "111111",
        "name": "Name 1",
    },{
        "id": "222222",
        "name": "Name 2"
    },{
        "id": "333333",
        "name": "Name 3"
    
    },{
        "id": "444444",
        "name": "Name 4"
    },{
        "id": "444444",
        "name": "Name 5"
    }
];

rafflex.raffle(names, 'id', 6, false);
```
### Return  

returns a json object with the raffle values
```javascript
[
  { id: '222222', name: 'Name 2' },
  { id: '444444', name: 'Name 4' },
  { id: '333333', name: 'Name 3' },
  { id: '111111', name: 'Name 1' }
]
```
### Note
	
> If you have any duplicate keys, **raffle-x** considers only the first one.

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