# random-index

> Return a random array-like index.

Latest version **1.0.4** (published 2016-04-25) · MIT license · 0 weekly downloads

## Install

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

## 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.4 |
| Published | 2016-04-25 |
| First published | 2016-04-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | bubkoo |
| Maintainers | bubkoo |
| Keywords | index, int, integer, number, generator, generate, random, randomly, randomize, chance, test, dice, mock |

## Links

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

## Dependencies (2)

- [random-natural](https://npm.io/package/random-natural.md) ^1.0.3
- [max-array-length](https://npm.io/package/max-array-length.md) ^1.0.0

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2016-04-25
- 1.0.3 — 2016-04-23
- 1.0.2 — 2016-04-15
- 1.0.1 — 2016-04-14
- 1.0.0 — 2016-04-14
- 0.0.0 — 2016-04-14

## README

# random-index

> Return a random array-like index.

[![MIT License](https://img.shields.io/badge/license-MIT_License-green.svg?style=flat-square)](https://github.com/mock-end/random-index/blob/master/LICENSE)

[![build:?](https://img.shields.io/travis/mock-end/random-index/master.svg?style=flat-square)](https://travis-ci.org/mock-end/random-index)
[![coverage:?](https://img.shields.io/coveralls/mock-end/random-index/master.svg?style=flat-square)](https://coveralls.io/github/mock-end/random-index)


## Install

```
$ npm install --save random-index 
```

## Usage

> For more use-cases see the [tests](https://github.com/mock-end/random-index/blob/master/test/spec/index.js)

```js
var randomIndex = require('random-index');

// API:
// - randomIndex([options]);

// options
// - min
// - max


randomIndex();     
// => 3561           

randomIndex({ max: 1 });    
// => 1

randomIndex({ min:10, max: 100 });
// => 64   
```

**Note**: these `min` and `max` are **inclusive**, so they are included in the range. 

This means `randomIndex({max: 2})` would return either `0`, `1`, or `2`.


## 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-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-index/issues/new).

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