diff options
author | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2017-07-16 00:15:06 -0400 |
---|---|---|
committer | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2017-07-16 00:15:06 -0400 |
commit | 74a6ec5fe5d1d10c465c231e64c7b964476464f3 (patch) | |
tree | a6a542f9bbf96cb90f1cb316937a8ba004a35889 /README.md | |
parent | 3e11f6c8268066068c45f4fd760516b8de4a4b28 (diff) |
Implement CLI
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -4,9 +4,30 @@ A dice expression parser and roller. ## Installation + # in a local node_modules/ npm install --save dicebag + # globally, to use the CLI + npm install -g dicebag -## Usage +## Command-line usage + + dicebag [-p] [<dice expression>] + +If a dice expression is provided, prints the result of rolling those dice and +exits. Otherwise, reads expressions from `stdin` in a loop. + +* `-p` print dice pools (default behavior is to print the dice's sum) + +### Examples + + $ dicebag 1d6 + 1 + $ dicebag "2d8 + 1d4" + 7 + $ dicebag -p "2d8 + 1d4" + [ 5, 3, 4 ] + +## Library usage const { parse, pool, roll } = require('dicebag') |