# get-lottery

> Generate lottery numbers based on probability.

Latest version **2.1.5** (published 2017-11-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install get-lottery
pnpm add get-lottery
yarn add get-lottery
bun add get-lottery
```

## 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 | 2.1.5 |
| Published | 2017-11-06 |
| First published | 2017-11-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Carlos E. Santos |
| Maintainers | devplex |

## Links

- npm: https://www.npmjs.com/package/get-lottery
- npm.io page: https://npm.io/package/get-lottery

## Dependencies (1)

- [request](https://npm.io/package/request.md) ^2.83.0

## Recent versions

- 2.1.5 (latest) — 2017-11-06
- 2.1.4 — 2017-11-05
- 2.1.3 — 2017-11-05
- 2.1.2 — 2017-11-05
- 2.1.1 — 2017-11-05
- 2.1.0 — 2017-11-05
- 2.0.0 — 2017-11-05
- 1.9.0 — 2017-11-05
- 1.8.0 — 2017-11-05
- 1.7.0 — 2017-11-05
- 1.6.0 — 2017-11-05
- 1.5.0 — 2017-11-05
- 1.4.0 — 2017-11-05
- 1.3.0 — 2017-11-05
- 1.2.0 — 2017-11-05
- … 2 more at https://npm.io/package/get-lottery/versions

## README

A Powerball Lottery api wrapper with added functionality.

## Installation
'get-lottery' is an npm module, and as such, can be installed using the `install` command.

	$ npm install get-lottery
## Usage
Get an api key at https://dev.socrata.com/foundry/data.ny.gov/8vkr-v8vh.

```javascript
let getLottery = require('get-lottery');
    
//set api key (optional)
getLottery.setKey('bjp8KrRvAPtuf809u1UXnI0Z8');
    
//generate potential lottery numbers based on data
getLottery.generateNumbers().then(result => {
	//returns array of numbers
});
```
## Documentation
### setKey
An api key is not required, but will allow you to make more requests per second.
```javascript
getLottery.setKey('bjp8KrRvAPtuf809u1UXnI0Z8');
```
### getAll
Get all Powerball data since 2010, including date, multiplier, and of course, winning numbers.
```javascript
getLottery.getAll().then(result => {
    //returns array of objects
});
```
### getWinningNumbers
Get only winning number data.
```javascript
//get winning numbers only
getLottery.getWinningNumbers().then(result => {
	//returns array of strings
});
    
//get winning numbers, counted
getLottery.getWinningNumbers(true).then(result => {
    //returns array of objects
    //id = number;
    //count = how many times the number appears in the data
});
```
### generateNumbers
Based on probability, return an array of numbers consituting future lottery numbers.
```javascript
getLottery.generateNumbers().then(result => {
    //returns array of numbers
});
```

## License
This module is under the MIT License. Feel free to use it to your liking.

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