New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

diceyjs

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

diceyjs

Helper for rolling dices

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

diceyjs

Javascript helper to roll dices for browsers and nodejs

Usage

There are many ways to use it. So use it as you may like.

var Dicey = require('./dicey.js');
Dicey.roll(3, 15); // Will return a random number from 3 to 15
Dicey.roll(50); // Will return a random number from 0 to 50
Dicey.roll('2d10'); // Will return a random number from 2 to 20

Randomizer Methods

By default are 5 randomizer methods.

NORMAL_ROLL : Just randomize, round the number and return it.

BEST_OF_TWO : Randomize twice and return the highest value.

BEST_OF_THREE : Randomize three times and return the highest value.

WORST_OF_TWO : Randomize twice and return the lowest value.

WORST_OF_THREE : Randomize three times and return the lowest value.

Example
Dicey.roll('2d10', 'BEST_OF_THREE');
Dicey.roll(10, 50, 'WORST_OF_THREE');

Keywords

FAQs

Package last updated on 22 Feb 2015

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc