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
4 weeks ago (0.1.0)

Utilities for generating random numbers.

import { randomIntegerBetween } from "@std/random";
import { randomSeeded } from "@std/random";
import { assertEquals } from "@std/assert";

const prng = randomSeeded(1n);

assertEquals(randomIntegerBetween(1, 10, { prng }), 3);
Built and signed on
GitHub Actions
View transparency log

Add Package

deno add jsr:@std/random

Import symbol

import * as mod from "@std/random";

---- OR ----

Import directly with a jsr specifier

import * as mod from "jsr:@std/random";

Add Package

npx jsr add @std/random

Import symbol

import * as mod from "@std/random";

Add Package

yarn dlx jsr add @std/random

Import symbol

import * as mod from "@std/random";

Add Package

pnpm dlx jsr add @std/random

Import symbol

import * as mod from "@std/random";

Add Package

bunx jsr add @std/random

Import symbol

import * as mod from "@std/random";