hhp-render
Renders PokerHands parsed with hhp to different formats, i.e. PokerStars and message boards.
Last updated 3 years ago by thlorenz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install hhp-render 
SYNC missed versions from official npm registry.

hhp-render build status

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 format

Status

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-render

API

renderPokerStars

Renders an hhp parsed hand in PokerStars format.

Parameters

  • hand Object the parsed hand
  • $0 Object options
    • $0.muckRevealed Object? if true includes cards revealed via Ignition as mucks (optional, default true)

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

  • $0 Object the configuration of the renderer
    • $0.text String? text to start with (optional, default '')
    • $0.summary Object the parsed then analyzed, scripted and summarized
    • $0.amountAsBB Boolean? show all amounts in big blind dominatians (optional, default false)
    • $0.showHeroCards Boolean? show hero cards as part of hands (i.e. don't hide in spoilers) (optional, default true)

Returns String the rendered hand

renderFacebook

Renders an hhp parsed + hha anazlyzed + scripted and then summarized hand to facebook format.

Parameters

  • $0 Object the configuration of the renderer (same as renderHtml)

Returns String the rendered hand

forums.renderTwoPlusTwo

Renders an hhp parsed + hha anazlyzed + scripted and then summarized hand to 2+2 forum format.

Parameters

  • $0 Object the configuration of the renderer (same as renderHtml)

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

  • $0 Object the configuration of the renderer (same as renderHtml)

Returns String the rendered hand

License

MIT

Current Tags

  • 0.2.0                                ...           latest (3 years ago)

1 Versions

  • 0.2.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (5)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |