Socket
Book a DemoInstallSign in
Socket

@rsonglab/random-generator

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rsonglab/random-generator

A simple random things generator

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Random Things Generator

It's a simple random things generator.

Install

npm i @ronsong/random-generator

Usage

const { RandomInteger, RandomBoolean, RandomRGB, RandomDate, RandomAnimals } = require("@ronsong/random-generator")

RandomInteger()
// 17

RandomInteger(1, 6)
// 4

RandomBoolean()
// false

RandomRGB()
// rgb(158, 218, 190)

RandomRGB(true)
// rgb(181, 206, 227, 0.3)

RandomDate()
// 2021-02-18T10:53:33.287Z

RandomDate(new Date().getTime(), new Date().getTime())
// 2021-05-12T04:57:07.319Z

RandomAnimals()
// giant-panda

...

live demo: https://runkit.com/embed/z954rwtibfpr

APIs

RandomInteger()

@param default min= 0, max = 100

Returns a random number.

RandomBoolean()

Return a random boolean (true/false).

RandomRGB()

@param default alpha = false

Return a random color in RGB.

RandomDate()

@param default start = 01/01/1900, end = new Date()

Return a random date

RandomAnimals()

Return a random animal

...

License

It is an open-source npm package licensed under the "MIT License". Please see the file LICENSE for license terms.

FAQs

Package last updated on 12 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.