Skip to main content

@ns/random@0.1.1
Built and signed on GitHub Actions

A utilities for calculating of random values.

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
6 months ago (0.1.1)

default

This module contains main functions to calc random values.

f
choice

Get random item from Array

f
choices

Get random items from Array

f
randInt

Get random integer

f
random

Get random value (0 <= x < 1)

I
RandOpts

This module functions's options

f
sample

Get random items from Array, not duplicated

f
shuffle

Shuffle array. In-place.

f
toShuffled

Shuffle array. The result is copyed. It don't change argment array.

f
uniform

Get random float value