hhp-render v0.2.0
hhp-render 
Renders PokerHands parsed with hhp to different formats, i.e. PokerStars and message boards.
Usage
const parse = require('hhp')
const analyze = require('hha')
const { script, summary } = require('hha')
const { renderHtml } = require('hhp-render')
const txt = fs.readFileSync(file, 'utf8')
const parsed = parse(txt)
const analyzed = analyze(parsed)
const scripted = script(analyzed)
const summarized = summarize(scripted)
const rendered = renderHtml({ summary })
console.log(rendered) // prints hand in html formatStatus
Renders to html, different forums and PokerStars.
Note that only for PokerStars a binary interface has been exposed.
Also all renderers require a script produced with hha except for PokerStars which renders a hand that was parsed with
hhp but not analyzed.
hhp-render <source-dir> <target-dir> --noreveal
Converts hand histories inside source dir to
PokerStars format and writes them to the target dir.
If --noreveal is NOT supplied revealed hands will be
included as mucked hands.Installation
npm install hhp-renderAPI
renderPokerStars
Renders an hhp parsed hand in PokerStars format.
Parameters
handObject the parsed hand$0Object options$0.muckRevealedObject? iftrueincludes cards revealed via Ignition as mucks (optional, defaulttrue)
Returns string hand rendered to be importable as PokerStars hand
renderHtml
Renders an hhp parsed + hha anazlyzed + scripted and then summarized hand to HTML format.
Parameters
$0Object the configuration of the renderer$0.textString? text to start with (optional, default'')$0.summaryObject the parsed then analyzed, scripted and summarized$0.amountAsBBBoolean? show all amounts in big blind dominatians (optional, defaultfalse)$0.showHeroCardsBoolean? show hero cards as part of hands (i.e. don't hide in spoilers) (optional, defaulttrue)
Returns String the rendered hand
renderFacebook
Renders an hhp parsed + hha anazlyzed + scripted and then summarized hand to facebook format.
Parameters
$0Object the configuration of the renderer (same asrenderHtml)
Returns String the rendered hand
forums.renderTwoPlusTwo
Renders an hhp parsed + hha anazlyzed + scripted and then summarized hand to 2+2 forum format.
Parameters
$0Object the configuration of the renderer (same asrenderHtml)
Returns String the rendered hand
forums.renderPocketFives
Renders an hhp parsed + hha anazlyzed + scripted and then summarized hand to pocket fives forum format PokerXFactor, CardRunners, IntelliPoker formats are identical.
Parameters
$0Object the configuration of the renderer (same asrenderHtml)
Returns String the rendered hand
License
MIT
8 years ago