Skip to main content

@std/random@0.1.0
Built and signed on GitHub Actions

UNSTABLE: Various utilities using random number generators. The package also provides seeded pseudo-random number generator.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
3 months ago (0.1.0)
type alias Prng
Unstable

A pseudo-random number generator implementing the same contract as Math.random, i.e. taking zero arguments and returning a random number in the range [0, 1). The behavior of a function that accepts a Prng an option may be customized by passing a Prng with different behavior from Math.random, for example it may be seeded.

Definition

Math.random

Add Package

deno add jsr:@std/random

Import symbol

import { type Prng } from "@std/random/between";

---- OR ----

Import directly with a jsr specifier

import { type Prng } from "jsr:@std/random/between";

Add Package

npx jsr add @std/random

Import symbol

import { type Prng } from "@std/random/between";

Add Package

yarn dlx jsr add @std/random

Import symbol

import { type Prng } from "@std/random/between";

Add Package

pnpm dlx jsr add @std/random

Import symbol

import { type Prng } from "@std/random/between";

Add Package

bunx jsr add @std/random

Import symbol

import { type Prng } from "@std/random/between";