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

Package detail

get-random-values-esm

sanity-io419.8kMIT1.0.2TypeScript support: included

A wrapper that rebundles get-random-values into ESM, so you can use it in your vite, skypack, or wherever you need ESM.

crypto, get-random-values, getRandomValues, webcrypto

readme

get-random-values-esm

A wrapper that rebundles get-random-values into ESM, so you can use it in your vite, skypack, or wherever you need ESM. Also adds support for node v15's WebCrypto support and TypeScript definitions.

Install

$ npm install get-random-values-esm

Usage

Same as before, but now with ESM imports:

import getRandomValues from 'get-random-values-esm'

console.log(getRandomValues(new Uint8Array(16)))

changelog

Changelog

1.0.2 (2024-02-14)

Bug Fixes

  • recursive call to getRandomValues (248e5a8)

1.0.1 (2024-02-14)

Bug Fixes

  • try global crypto if no window is defined in ESM module (#2) (a28ae07)