# rando

> random generator

Latest version **0.7.1** (published 2014-04-01) · Apache v2.0 license · 0 weekly downloads

## Install

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

Provides the command `rando`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.7.1 |
| Published | 2014-04-01 |
| First published | 2013-08-03 |
| Weekly downloads | 0 |
| License | Apache v2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Allen Heavey |
| Maintainers | dmdgeeker |
| Keywords | random |

## Links

- npm: https://www.npmjs.com/package/rando
- Repository: https://github.com/xionglun/rando
- Issues: https://github.com/xionglun/rando/issues
- npm.io page: https://npm.io/package/rando

## Recent versions

- 0.7.1 (latest) — 2014-04-01
- 0.7.0 — 2014-04-01
- 0.6.8 — 2014-02-13
- 0.6.7 — 2014-02-13
- 0.6.6 — 2014-02-13
- 0.6.5 — 2014-02-04
- 0.6.4 — 2013-12-24
- 0.6.2 — 2013-12-22
- 0.6.1 — 2013-12-04
- 0.6.0 — 2013-11-22
- 0.5.2 — 2013-10-28
- 0.5.1 — 2013-10-23
- 0.5.0 — 2013-09-11
- 0.4.9 — 2013-09-10
- 0.4.8 — 2013-09-10
- … 23 more at https://npm.io/package/rando/versions

## README

rando
=====

This is a random generator.


   
[![Build Status](https://travis-ci.org/xionglun/rando.png?branch=master)](https://travis-ci.org/xionglun/rando)
[![Dependency Status](https://gemnasium.com/xionglun/rando.png)](https://gemnasium.com/xionglun/rando)
   

------
   

## Installation    
```bash
  $ npm install rando [ -g ]
```

   

## Usage
  ```javascript
    var rando = require('rando');  // after install rando.
    var params = {
      type: 'int',
      min: 10,
      max: 300,
      number: 20
    };
    var res = rando(params); // res will be an array contains 20 elements.
  ```
  * PARAMS
    <ol>
      <li> __type__  _required_ </li>
      <li> __min__   _optional_     default: 0</li>
      <li> __max__   _optional_     default: 256</li>
      <li> __numbe__  _optional_    default: 1 </li>
      <li> __file__   _optional_    default: console</li>
      <li> __length__   _optional_  default: 3</li>
      <li> __sort__   _optional_  default: false</li>
    </ol>
  * __TYPE__
    <ol>
      <li> __int__             // default: an integer number.  </li>
      <li> __float__           // default: a float number.    </li>
      <li> __string__          // default: a string not a regular english word.</li>
      <li> __word__            // default: a regular english word.  </li>
      <li> __bool__            // default: a boolean value.  </li>
    </ol>
  * _min_
    * int && float: the minimum number.
    * string and word: the shortest characters will be return.
  * _max_
    * int && float: the maximum number.
    * string and word: the longest characters will be return.
  * _length_
    * float: the decimal.
    * string and word: length of characters.
  * _count_
    * number needed.
  * _file_
    * output file.
  * _sort_
    * sort the result.
   
   

## Terminal Usage
How to use it:   
  ```sh
   $ rando -t word -A 20 -Z 3
  ```

__PARAMETERS__   
  ```
    -h, --help          // help
    -t, --type          // [REQUIRED]random type, such as: int, float, string, word...
    -A, --max           // maximum number for int and float, most characters for string and word.
    -Z, --min           // minimum number for int and float, least characters for string and word.
    -n, --number        // number needed.
    -s, --sort          // sort results;
    -f, --file          // ouput filepath.
    -l, --length        // the length for string and word, will cover min and max. or the decimal for float.
    -v, --version       // output version.
  ```

        
## Example
1. require rando  

   ```javascript 
     var rando = require('rando');  
    ```
2. parameter  

    ```javascript
        var randoInt = {
          type: 'int',
          min: 10,
          max: 23
        };
    ```

3. pass parameter to ___rando()___   
  ```javascript
    var res = rando(randoInt);
  ```
   
More examples:   
[Examples](https://github.com/xionglun/rando/wiki)

   
   
## Test
```bash
  $ npm install // install develop dependecies.
  $ npm test   // should install jshint first.
```


## License

Copyright (c) 2013 Allen Heavey  &lt;xheavey@gmail.com&gt;

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

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