# object-random

> Get random, unique values from an object

Latest version **2.1.0** (published 2015-05-25) · MIT license · 0 weekly downloads

## Install

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

## 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.1.0 |
| Published | 2015-05-25 |
| First published | 2015-05-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Andreas Gillström |
| Maintainers | gillstrom |
| Keywords | key, object, random, randomize, unique, value |

## Links

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

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.1.0 (latest) — 2015-05-25
- 2.0.0 — 2015-05-25
- 1.0.3 — 2015-05-24
- 1.0.2 — 2015-05-24
- 1.0.1 — 2015-05-24
- 1.0.0 — 2015-05-24

## README

# object-random [![Build Status](https://travis-ci.org/gillstrom/object-random.svg?branch=master)](https://travis-ci.org/gillstrom/object-random)

> Get random, unique values from an object

## Install

```
$ npm install --save object-random
```


## Usage

```js
var objectRandom = require('object-random');
var obj = {
	a: 0,
	b: 1,
	c: 2,
	d: 3,
	e: 4
};

objectRandom(obj);
//=> [4]

objectRandom(obj, {count: 3});
//=> [0, 3, 2]
```


### objectRandom(object, options)

Returns an `array`.

#### object

*Required*  
Type: `object`

Object to pick from.

#### options

Type: `object`

Options to pass.

##### count

Type: `number`  
Default: `1`

Number of returned values.


## License

MIT © [Andreas Gillström](http://github.com/gillstrom)

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