Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@botpoker/hand

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@botpoker/hand

Evaluate poker hold'em hands

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
158
decreased by-38.76%
Maintainers
1
Weekly downloads
 
Created
Source

@botpoker/hand

You can install @botpoker/hand via npm:

npm i @botpoker/hand --save

About @botpoker/hand

@botpoker/hand does just one thing: it tries to guess the strength of a given poker combination. It exports only one method:

const whatIs = require("@botpoker/hand");

The whatIs function expects to be called with an array of five cards. A card is an object with properties rank, and type, like the one used by poker-deck.

whatIs([
  { rank: "6", type: "H" },
  { rank: "7", type: "D" },
  { rank: "9", type: "S" },
  { rank: "8", type: "C" },
  { rank: "5", type: "C" },
]);

This is a straight of 9... however @botpoker/hand know this is a combination with a strength of 4 compared to the other possible poker combinations.

whatIs([
  { rank: "2", type: "D" },
  { rank: "3", type: "D" },
  { rank: "J", type: "D" },
  { rank: "5", type: "D" },
  { rank: "6", type: "D" },
]);

This is a flush, and the highest card is Jack; so this combination has a strength of 5. In this case the expected result is:

{ 
  name: "Flush",
  strength: 5,
  rank: "J",
  kickers: ["6", "5", "3", "2"],
}

Keywords

FAQs

Package last updated on 02 May 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc