ptz-math
Version:
ptz-math is a library for math operations such as random()
62 lines (47 loc) • 1.59 kB
Markdown
# ptz-math
[](https://travis-ci.org/angeloocana/ptz-math)
[](https://www.npmjs.com/package/ptz-math)
[](http://codecov.io/github/angeloocana/ptz-math)
[](https://gemnasium.com/angeloocana/ptz-math)
[](https://www.bithound.io/github/angeloocana/ptz-math)
[](http://opensource.org/licenses/MIT)
## Translations
[pt-br](https://github.com/angeloocana/ptz-math/blob/master/README.pt-br.md)
[en-us](https://github.com/angeloocana/ptz-math/blob/master/README.md)
> ptz-math is a javascript library for math operations
>
> Be welcome to learn, help and play!!!
## Docs
[Full docs](https://angeloocana.github.io/ptz-math/)
## Use
### Install
```
npm install --save ptz-math
```
### How to use
Get random number between 2 and 8:
```js
import { random } from ptz-math;
const min = 2;
const max = 8;
const randomNumber = random(min, max);
```
Get random item from array:
```js
import { getRandomItem } from ptz-math;
const list = ['a', 'b', 'c', 'd'];
const randomItem = getRandomItem(list);
```
## Contribute
### NPM Global packages
```
npm install -g ts-node babel-cli
```
### Setup
```
npm install
```
### Test
```
npm test
```