Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
This is a little dice utility library with some convenience methods wrapped around a little dice function.
v1.0.0
npm install ck-dice
The index.js
file can be found in the src
directory. This project is written in CoffeeScript.
When you require the library you get an instance of the DiceRoller class:
var diceRoller = require('ck-dice');
The main usage is the rollDice
method. rollDice
takes two parameters, the number of sides of the dice you want to roll and the number of dice you want rolled. You will get the sum of the number of dice rolled as a result. The next code example will roll four, six sided die.
var diceRoller = require('ck-dice');
console.log( diceRoller.rollDice(6, 4);
// result: 13
If you want to get an array of rolled dice back you can use the rollList
function. This function also takes the number of sides and the number of dice as parameters and returns an array of integers.
var diceRoller = require('ck-dice');
console.log( diceRoller.rollList(10, 10);
// result: [ 4, 8, 3, 1, 6, 9, 2, 9, 3, 9 ]
There are also 9 convenience methods on the object representing the standard dice you could use. These methods take the number of dice and return a integer representing the sum the of the rolls. The methods area called as follows:
d2()
d4()
d6()
d8()
d10()
d12()
d18()
d20()
d100()
If you find a bug or want to add some features, let me know. This project is still under active development.
FAQs
A little dice helper library
The npm package ck-dice receives a total of 6 weekly downloads. As such, ck-dice popularity was classified as not popular.
We found that ck-dice demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.