Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

iso-random-stream

hugomrdias85.5kMIT2.0.2TypeScript support: included

Random bytes stream for node and browser

stream, random, bytes, isomorphic, node, browser

readme

iso-random-stream NPM Version NPM Downloads NPM License tests codecov

Random bytes stream for node and browser. Uses crypto.randomBytes(size[, callback]) in node and 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

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

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

API

randomStream(size)

Returns a stream.Readable. By default, it produces infinite data.

size

Type: number Default: Infinity

Number of random bytes to produce.

License

MIT © Hugo Dias

changelog

Changelog

2.0.2 (2021-12-03)

Bug Fixes

2.0.1 (2021-12-02)

Bug Fixes

  • add typesVersions to package.json (#87) (df6e2dd)

2.0.0 (2021-04-06)

⚠ BREAKING CHANGES

  • named exports and buffer removed

Features

  • types, format, remove buffer and named exports (#55) (5d71250)

Bug Fixes

  • fix documentation for named exports (0de2ab9)