npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

hha-encode

v0.1.3

Published

Encodes and decodes processed Pokerhands.

Readme

hha-encode build status

Encodes and decodes processed Pokerhands.

const { encode, decode } = require('hha-encode').summary

const original =
  { header:
    { room: 'pokerstars',
      gametype: 'tournament',
      currency: '$',
      donation: 0.91,
      rake: 0.09,
      pokertype: 'holdem',
      limit: 'nolimit',
      sb: 400,
      bb: 800,
      ante: 50,
      level: 'xi',
      maxseats: 9 },
    seats:
    [ { pos: 'SB', chipsBB: 19.3 },
      { pos: 'BB', chipsBB: 27.6 },
      { pos: 'CO', chipsBB: 19.8 },
      { pos: 'BU', chipsBB: 17.6 } ],
    chipStackRatio: { label: 'M', amount: 16 },
    preflopSummary: { cards: { card1: '4c', card2: '2d' }, pos: 'BB' },
    preflopActions:
    [ { pos: 'CO', type: 'raise', amountBB: 2 },
      { pos: 'BU', type: 'call', amountBB: 2 },
      { type: 'folds', number: 2 } ],
    flopSummary:
    { potBB: 5.8,
      board: [ '3c', 'Jc', '3h' ],
      playersInvolved: 2 },
    flopActions:
    [ { pos: 'CO', type: 'bet', amountBB: 3 },
      { pos: 'BU', type: 'call', amountBB: 3 } ],
    turnSummary: { potBB: 11.8, board: '6h', playersInvolved: 2 },
    turnActions:
    [ { pos: 'CO', type: 'check' },
      { pos: 'BU', type: 'bet', amountBB: 2 },
      { pos: 'CO', type: 'call', amountBB: 2 } ],
    riverSummary: { potBB: 15.8, board: '3d', playersInvolved: 2 },
    riverActions:
    [ { pos: 'CO', type: 'check' },
      { pos: 'BU', type: 'bet', amountBB: 4 },
      { pos: 'CO', type: 'call', amountBB: 4 } ],
    totalPot: { bb: 23.8 },
    spoilers:
    [ { pos: 'CO', cards: { card1: 'Td', card2: 'Tc' } },
      { pos: 'BU', cards: { card1: 'Qs', card2: 'Jh' } } ] }

const encoded = encode(original)
const decoded = decode(encoded)

console.log(encoded)
console.log(decoded)
000aB2G0Mm241401JBAa2WkWiDj0000w0001s0002U0003k08Y43184Ka36e2m*0a0K1e0K502*2a0U1e0U*392e0K1a0K*392e0e1a0e*9HIACB*
{ header:
   { room: 'pokerstars',
     gametype: 'tournament',
     currency: '$',
     pokertype: 'holdem',
     limit: 'nolimit',
     maxseats: 9,
     level: 'xi',
     donation: 0.91,
     rake: 0.09,
     sb: 400,
     bb: 800,
     ante: 50 },
  totalPot: { bb: 23.8 },
  chipStackRatio: { label: 'M', amount: 16 },
  preflopSummary: { pos: 'BB', cards: { card1: '4c', card2: '2d' } },
  flopSummary: { board: [ '3c', 'Jc', '3h' ], potBB: 5.8, playersInvolved: 2 },
  turnSummary: { board: '6h', potBB: 11.8, playersInvolved: 2 },
  riverSummary: { board: '3d', potBB: 15.8, playersInvolved: 2 },
  seats:
   [ { pos: 'SB', chipsBB: 19.3 },
     { pos: 'BB', chipsBB: 27.6 },
     { pos: 'CO', chipsBB: 19.8 },
     { pos: 'BU', chipsBB: 17.6 } ],
  spoilers:
   [ { pos: 'CO', cards: [Object] },
     { pos: 'BU', cards: [Object] } ],
  preflopActions:
   [ { type: 'raise', amountBB: 2, pos: 'CO' },
     { type: 'call', amountBB: 2, pos: 'BU' },
     { type: 'folds', number: 2 } ],
  flopActions:
   [ { type: 'bet', amountBB: 3, pos: 'CO' },
     { type: 'call', amountBB: 3, pos: 'BU' } ],
  turnActions:
   [ { type: 'check', pos: 'CO' },
     { type: 'bet', amountBB: 2, pos: 'BU' },
     { type: 'call', amountBB: 2, pos: 'CO' } ],
  riverActions:
   [ { type: 'check', pos: 'CO' },
     { type: 'bet', amountBB: 4, pos: 'BU' },
     { type: 'call', amountBB: 4, pos: 'CO' } ] }

Installation

npm install hhaencode

API

summary.encode

Encodes a PokerHand summary that was obtained via hha.summary.

Parameters

  • summary Object the summary to encode

Returns String the custom base64 encoded string containing the summary

summary.decode

Decodes a PokerHand summary encoded via summary.encode.

Parameters

  • s String custom base64 encoded summary

Returns Object decoded summary

License

MIT