Generates random things. Not maintained at the moment.
Find a file
2022-12-13 06:46:33 -08:00
.github Create dependabot.yml 2020-10-29 10:11:52 -07:00
.vscode updates 2020-10-28 16:01:50 -07:00
src Added features and fixes 2020-10-25 17:50:58 -07:00
.eslintrc Added features and fixes 2020-10-25 17:50:58 -07:00
.gitignore updates 2020-10-28 16:01:50 -07:00
index.js Added features and fixes 2020-10-25 17:50:58 -07:00
LICENSE updates 2020-10-28 16:01:50 -07:00
package-lock.json Bump chalk from 5.1.0 to 5.2.0 2022-12-09 17:00:52 +00:00
package.json Bump chalk from 4.1.2 to 5.0.0 2021-11-26 17:04:06 +00:00
README.md fixes 2020-10-28 16:45:29 -07:00

random | Random generator and more
Status: Working Progress

Repo Size Total alerts Language grade: JavaScript

random

Random generator and more

Documentation (Not set up yet)

Random Generators

Unchecked boxes are planned but not worked on features. More features to comes as time goes on.

  • Integer
  • Float
  • String
  • Character
  • Word
  • HEX color (Working Progress)
  • Time (Working Progress)
  • Date (Working Progress)
  • Day
  • Month

Random Selection

  • Shuffle Arrays
  • Choose random item from array

Setup

Requires NodeJS v14 or higher. This module was created in NodeJS v14.13.1

Require

const random = require('@spidergaming/random');

Examples:

Generate a random number

random.number(min?, max?, not?)

// Get a random integer between 0 and 1
console.log(`Random 0 - 1: ${random.number()}`);

// Get a random integer between 0 and 4
console.log(`Random 0 - 4: ${random.number(4)}`);

// Get a random integer between 50 and 100
console.log(`Random 50 - 100: ${random.number(50, 100)}`);

// Get a random number between 0 and 5 that is not 3
console.log('0 - 5 not 3:', random.number(0, 5, 3));

For almost all functions, check out src/tests/test.js

Maintainers

License

random is released under the MIT License. Read here for more information.