
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@jprochazk/roll-dice
Advanced tools
Evaluate standard dice roll notation.
$ npm i roll-dice@npm:jprochazk/roll-dice
import { roll } from "roll-dice";
roll("5d6") // roll a 6-sided die 5 times.
roll("5d6 + 10") // roll a 6-sided die 5 times, and add 10 to the result.
| description | example | |
|---|---|---|
a + b | add a and b | 1 + 1 |
a - b | subtract b from a | 1 - 1 |
a * b | multiply a by b | 1 * 1 |
a / b | divide a by b | 1 / 1 |
- b | negates b | -1 |
d a | rolls an a-sided die | d5 |
a d b | rolls a b-sided die, a times | 2d10 |
( a ) | grouping expression, used to specify precedence | (1+1) |
Every a or b in the above table may contain another expression, and expressions may be arbitrarily nested. For example (10+5)*2+(5d10) is a valid expression.
lib.rs - entry point for the WASM moduleparse.rs - a recursive descent parser which outputs a list of instructions in postfix notation.eval.rsThe library is written in Rust, and uses wasm-pack for packing it as a WASM module and publishing it on NPM. Various commands (available in the justfile) are run using just.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
FAQs
evaluate standard dice roll notation
We found that @jprochazk/roll-dice demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.