# randomval

> Generate random values.

Latest version **2.0.5** (published 2016-07-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install randomval
pnpm add randomval
yarn add randomval
bun add randomval
```

## 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.0.5 |
| Published | 2016-07-30 |
| First published | 2015-08-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Taka Okunishi |
| Maintainers | okunishinishi |
| Keywords | random, generator |

## Links

- npm: https://www.npmjs.com/package/randomval
- Repository: https://github.com/okunishinishi/node-randomval
- Homepage: https://github.com/okunishinishi/node-randomval#readme
- Issues: https://github.com/okunishinishi/node-randomval/issues
- npm.io page: https://npm.io/package/randomval

## Dependencies (2)

- [argx](https://npm.io/package/argx.md) ^3.0.0
- [uuid](https://npm.io/package/uuid.md) ^2.0.2

## Recent versions

- 2.0.5 (latest) — 2016-07-30
- 2.0.4 — 2016-07-27
- 2.0.3 — 2016-07-21
- 2.0.2 — 2016-07-21
- 2.0.1 — 2016-07-11
- 2.0.0 — 2016-07-11
- 1.0.4 — 2015-09-28
- 1.0.3 — 2015-09-19
- 1.0.2 — 2015-08-23
- 1.0.1 — 2015-08-23
- 1.0.0 — 2015-08-23

## README

randomval
==========

<!---
This file is generated by ape-tmpl. Do not update manually.
--->

<!-- Badge Start -->
<a name="badges"></a>

[![Build Status][bd_travis_shield_url]][bd_travis_url]
[![Code Climate][bd_codeclimate_shield_url]][bd_codeclimate_url]
[![Code Coverage][bd_codeclimate_coverage_shield_url]][bd_codeclimate_url]
[![npm Version][bd_npm_shield_url]][bd_npm_url]

[bd_repo_url]: https://github.com/okunishinishi/node-randomval
[bd_travis_url]: http://travis-ci.org/okunishinishi/node-randomval
[bd_travis_shield_url]: http://img.shields.io/travis/okunishinishi/node-randomval.svg?style=flat
[bd_travis_com_url]: http://travis-ci.com/okunishinishi/node-randomval
[bd_travis_com_shield_url]: https://api.travis-ci.com/okunishinishi/node-randomval.svg?token=
[bd_license_url]: https://github.com/okunishinishi/node-randomval/blob/master/LICENSE
[bd_codeclimate_url]: http://codeclimate.com/github/okunishinishi/node-randomval
[bd_codeclimate_shield_url]: http://img.shields.io/codeclimate/github/okunishinishi/node-randomval.svg?style=flat
[bd_codeclimate_coverage_shield_url]: http://img.shields.io/codeclimate/coverage/github/okunishinishi/node-randomval.svg?style=flat
[bd_gemnasium_url]: https://gemnasium.com/okunishinishi/node-randomval
[bd_gemnasium_shield_url]: https://gemnasium.com/okunishinishi/node-randomval.svg
[bd_npm_url]: http://www.npmjs.org/package/randomval
[bd_npm_shield_url]: http://img.shields.io/npm/v/randomval.svg?style=flat
[bd_standard_url]: http://standardjs.com/
[bd_standard_shield_url]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg

<!-- Badge End -->


<!-- Description Start -->
<a name="description"></a>

Generate random values.

<!-- Description End -->




<!-- Sections Start -->
<a name="sections"></a>

<!-- Section from "doc/guides/01.Installation.md.hbs" Start -->

<a name="section-doc-guides-01-installation-md"></a>

Installation
-----

```bash
npm install randomval --save
```


<!-- Section from "doc/guides/01.Installation.md.hbs" End -->

<!-- Section from "doc/guides/02.Usage.md.hbs" Start -->

<a name="section-doc-guides-02-usage-md"></a>

Usage
----

```javascript
#!/usr/bin/env/node

const randomval = require('randomval')

// ------------------------
// Random Bool
// ------------------------
console.log(randomval.randomBool()) //-> true
console.log(randomval.randomBool()) //-> true
console.log(randomval.randomBool()) //-> true


// ------------------------
// Random Date
// ------------------------
console.log(randomval.randomDate()) //-> Mon Nov 28 2016 04:50:44 GMT+0900 (JST)
console.log(randomval.randomDate()) //-> Mon Nov 07 2016 20:27:57 GMT+0900 (JST)
console.log(randomval.randomDate()) //-> Sun Nov 27 2016 10:53:39 GMT+0900 (JST)


// ------------------------
// Random Hash
// ------------------------
console.log(randomval.randomHash()) //-> 8d2a76c0e7b04bb690c7a17bfe7d03c5
console.log(randomval.randomHash()) //-> 613a056fd107413e9b6787a6055d78ed
console.log(randomval.randomHash()) //-> bd1b3f70b4f4466d87cf0dda704936b7


// ------------------------
// Random Int
// ------------------------
console.log(randomval.randomInt()) //-> 1423455250182315
console.log(randomval.randomInt()) //-> -7677881246134615
console.log(randomval.randomInt()) //-> -380459522751636


// ------------------------
// Random
// ------------------------
console.log(randomval.random()) //-> 0.46031310883760845
console.log(randomval.random()) //-> 0.24084973502152018
console.log(randomval.random()) //-> 0.01482755843377448



```



<!-- Section from "doc/guides/02.Usage.md.hbs" End -->

<!-- Section from "doc/guides/03.API Guide.md.hbs" Start -->

<a name="section-doc-guides-03-a-p-i-guide-md"></a>

API Guide
---------

| Signature | Description |
| ---- | ----- |
| **.random()** | Random number between 0 and 1 |
| **.randomBool()** | Random boolean. (`true` or `false`) |
| **.randomInt()** | Random integer value |
| **.randomInt(min, max)** | Random integer value in range |
| **.randomHash()** | Random hash string |
| **.randomHash(len)** | Random hash string with length |
| **.randomDate()** | Random date |
| **.randomDate(min, max)** | Random date in range |

<!-- Section from "doc/guides/03.API Guide.md.hbs" End -->


<!-- Sections Start -->


<!-- LICENSE Start -->
<a name="license"></a>

License
-------
This software is released under the [MIT License](https://github.com/okunishinishi/node-randomval/blob/master/LICENSE).

<!-- LICENSE End -->


<!-- Links Start -->
<a name="links"></a>

Links
------

+ [random-js][random_js_url]

[random_js_url]: https://www.npmjs.com/package/random-js

<!-- Links End -->

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