# random-strr

> Return a random string.

Latest version **1.0.0** (published 2016-04-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install random-strr
pnpm add random-strr
yarn add random-strr
bun add random-strr
```

## 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.0 |
| Published | 2016-04-26 |
| First published | 2016-04-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | bubkoo |
| Maintainers | bubkoo |
| Keywords | string, str, random, randomly, randomize, chance, test, dice, mock |

## Links

- npm: https://www.npmjs.com/package/random-strr
- Repository: https://github.com/mock-end/random-strr
- Homepage: https://github.com/mock-end/random-strr#readme
- Issues: https://github.com/mock-end/random-strr/issues
- npm.io page: https://npm.io/package/random-strr

## Dependencies (3)

- [to-length](https://npm.io/package/to-length.md) ^1.0.1
- [random-char](https://npm.io/package/random-char.md) ^1.0.4
- [random-natural](https://npm.io/package/random-natural.md) ^1.0.3

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-04-26

## README

# random-strr

> Return a random string.


[![MIT License](https://img.shields.io/badge/license-MIT_License-green.svg?style=flat-square)](https://github.com/mock-end/random-strr/blob/master/LICENSE)
  
[![build:?](https://img.shields.io/travis/mock-end/random-strr/master.svg?style=flat-square)](https://travis-ci.org/mock-end/random-strr)
[![coverage:?](https://img.shields.io/coveralls/mock-end/random-strr/master.svg?style=flat-square)](https://coveralls.io/github/mock-end/random-strr)
  
  
## Install
  
```
$ npm install --save random-strr 
```
  
## Usage
  
```js
var randomString = require('random-strr');
  
// API
// - randomString([options]);
  
// options
// - pool
// - length
// - min
// - max
```
By default it will return a string with random length of `5-20` characters and will contain any of the following characters.

```js
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~!@#$%^&()*_+-={}[]'
```

Can optionally specify a length and the string will be exactly that length:

```js
randomString({ length: 5 });
// => 'YN%fG'
```

Can optionally specify min, max, or both to limit the range.

```js
randomString({ min: 8 });
// => huepevesik

randomString({ max: 10 });
// => biwuwkef

randomString({ min: 10, max: 40 });
// => omoemowawahteze
```

Can optionally specify a pool and the string will be generated with characters only from that pool.

```js
randomString({ pool: 'abcde' });
// => 'cccdeeabedebb'
```

Of course these options can be combined.

```js
randomString({ length: 5, pool: 'abcde' });
=> 'cbbdc'
```
  
## Related

- [random-integral](https://github.com/mock-end/random-integral) - Return a random integer.
- [random-natural](https://github.com/mock-end/random-natural) - Return a random natural number.
- [random-decimal](https://github.com/mock-end/random-decimal) - Return a random decimal.
- [random-floating](https://github.com/mock-end/random-floating) - Return a random floating point number.
- [random-index](https://github.com/mock-end/random-index) - Return a random array-like index.
- [random-binary](https://github.com/mock-end/random-binary) - Return a random binary number.
- [random-octal](https://github.com/mock-end/random-octal) - Return a random octal number.
- [random-hexadecimal](https://github.com/mock-end/random-hexadecimal) - Return a random hexadecimal number.
- [random-unicode](https://github.com/mock-end/random-unicode) - Return a random unicode. 
- [random-bool](https://github.com/mock-end/random-bool) - Return a random boolean (true/false).
- [random-char](https://github.com/mock-end/random-char) - Return a random char.
  

## Contributing
  
Pull requests and stars are highly welcome.

For bugs and feature requests, please [create an issue](https://github.com/mock-end/random-strr/issues/new).

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