Skip to content

source compatible seed based RNG that allows mixed type output

License

Notifications You must be signed in to change notification settings

environment-safe/random

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@environment-safe/random

seed based multi type random number generation based on seedrandom by davidbau but as an ESM source compatible on the server and in the browser with a multitype generator allowing a single seed to generate many types.

Usage

const generator = new Random({seed: 'some-string-seed-value'});
const aFloatRatio = generator.random();

Testing

Run the es module tests to test the root modules

npm run import-test

to run the same test inside the browser:

npm run browser-test

to run the same test headless in chrome:

npm run headless-browser-test

to run the same test inside docker:

npm run container-test

Run the commonjs tests against the /dist commonjs source (generated with the build-commonjs target).

npm run require-test

Development

All work is done in the .mjs files and will be transpiled on commit to commonjs and tested.

If the above tests pass, then attempt a commit which will generate .d.ts files alongside the src files and commonjs classes in dist

About

source compatible seed based RNG that allows mixed type output

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published