# iso-random-stream

> Random bytes stream for node and browser

Latest version **2.0.2** (published 2021-12-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install iso-random-stream
pnpm add iso-random-stream
yarn add iso-random-stream
bun add iso-random-stream
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2021-12-03 |
| First published | 2018-09-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 2 |
| Unpacked size | 8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Hugo Dias |
| Maintainers | hugomrdias |
| Keywords | stream, random, bytes, isomorphic, node, browser |

## Links

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

## Dependencies (2)

- [events](https://npm.io/package/events.md) ^3.3.0
- [readable-stream](https://npm.io/package/readable-stream.md) ^3.4.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 2.0.2 (latest) — 2021-12-03
- 2.0.1 — 2021-12-02
- 2.0.0 — 2021-04-06
- 1.1.2 — 2021-04-06
- 1.1.1 — 2019-09-26
- 1.1.0 — 2018-12-17
- 1.0.0 — 2018-09-18

## README

# iso-random-stream [![NPM Version](https://img.shields.io/npm/v/iso-random-stream.svg)](https://www.npmjs.com/package/iso-random-stream) [![NPM Downloads](https://img.shields.io/npm/dt/iso-random-stream.svg)](https://www.npmjs.com/package/iso-random-stream) [![NPM License](https://img.shields.io/npm/l/iso-random-stream.svg)](https://www.npmjs.com/package/iso-random-stream) [![tests](https://github.com/hugomrdias/iso-random-stream/actions/workflows/main.yml/badge.svg)](https://github.com/hugomrdias/iso-random-stream/actions/workflows/main.yml) [![codecov](https://codecov.io/gh/hugomrdias/iso-random-stream/badge.svg?branch=master)](https://codecov.io/gh/hugomrdias/iso-random-stream?branch=master)

> Random bytes stream for node and browser. Uses [crypto.randomBytes(size[, callback])](https://nodejs.org/api/crypto.html#crypto_crypto_randombytes_size_callback) in node and [Crypto.getRandomValues()](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) in the browser. We use Buffer to keep the interfaces and returns values consistent, so make sure your bundler includes `buffer` in the browser.

## Install

```
$ npm install iso-random-stream
```

## Usage

```js
const { randomStream } = require('iso-random-stream')

randomStream('100').pipe(process.stdout)
```

## API

### randomStream(size)

Returns a [`stream.Readable`](https://nodejs.org/api/stream.html#stream_readable_streams). By default, it produces infinite data.

#### size

Type: `number`
Default: `Infinity`

Number of random bytes to produce.

## License

MIT © [Hugo Dias](http://hugodias.me)

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