{"_id":"@botpoker/engine-holdem","_rev":"4-0e5a71bc6871d183692f0bb48b29746e","name":"@botpoker/engine-holdem","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@botpoker/engine-holdem","version":"1.0.0","description":"Texas Hold'em poker engine","main":"tournament.js","engines":{"node":">=14.0.0"},"scripts":{"demo":"node demo/live.js --run","demo:debug":"node demo/live.js | node --inspect-brk demo/tournament-debug.js","lint":"eslint tournament.js domain/** engine/** logger/**","test":"npm run lint && jest","test:debug":"node --inspect-brk ./node_modules/jest/bin/jest"},"repository":{"type":"git","url":"git+https://github.com/brunoscopelliti/poker-holdem-engine.git"},"keywords":["poker engine","poker holdem engine","poker","hold'em","poker hold'em","hold'em engine"],"author":{"name":"Bruno Scopelliti"},"license":"MIT","bugs":{"url":"https://github.com/brunoscopelliti/poker-holdem-engine/issues"},"homepage":"https://github.com/brunoscopelliti/poker-holdem-engine","dependencies":{"knuth-shuffle":"1.0.8","poker-combinations":"1.2.2","poker-deck":"1.0.2","poker-rank":"2.0.2","request":"2.88.2","winston":"3.3.3"},"devDependencies":{"body-parser":"1.19.0","chalk":"4.1.1","eslint":"7.25.0","eslint-config-bruno":"3.0.0","express":"4.17.1","jest":"26.6.3","pre-commit":"1.2.2"},"gitHead":"30ae4d024e9de646cbbb8c3ecf440ed77c75cd8c","_id":"@botpoker/engine-holdem@1.0.0","_nodeVersion":"15.9.0","_npmVersion":"7.5.3","dist":{"integrity":"sha512-Sg3J/3qls1iXEVMK6ZTERnFOnu7d79Lt7XRQvvAnGbz0JCZjIWgAlS5pbzl6jjucRe6injZFRQZZ9kFXFlcoTw==","shasum":"28029cfd71f57a9d42133c637dabb3e3ea25c39c","tarball":"https://registry.npmjs.org/@botpoker/engine-holdem/-/engine-holdem-1.0.0.tgz","fileCount":99,"unpackedSize":129243,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjHx2CRA9TVsSAnZWagAAG50P/1L7ODlrKCsTp7oECmMK\nzbINWCgKX7bQsM44yZl+ntzX7nlq47gO4+zpaKAR54UqkI9+FDON0Kjs0/MA\nPjC4hvN3cNBhNKx6BQf9OCo7DYL3Nmm2Om3xFQl49Ae8x2cEG7k9nUnyJ0H2\nNBVRU5P8i60dOWNZ18Md+CFk2itYxiwO4QjuTQOdac9nxcb1pg9fWr3nDlMt\nqWZ/Gi573Vq3AUM5pYKbPL/Tm+zGQbC99Lfc107Zs5q3V1Jb87g3eNZpDx57\n4k28rGXqyPp6E+aetCpoY/La3k/X5M4p2bPHvf8khNY9IcraJ9V6vWgyiDQJ\n28lTQev6x6KzhE51X3VnMYnNsboGlcedmwYZ++V/6azCDBP4hmpgjBKTqdr2\nd8TvP3A/+PTZ2gP9qpI6/0W6ldSvFJJozkU+SfiS479CbFTCoO7ywEtl0S/H\nCcYKzFNEoaghaxNlgJNCUFJZZk03NcqcgrK4BxTAeMq1Yn39X+f/zYt8I1wR\nEHhdtjtnz0+6OEK7iF/+JRxx6sOQEPtmr96zIJ1y4R4JgU130JABgNN7cGn5\nLRiu1bQcdrWmzcecbrsmAmm8kPL88o2Tak5G6gRktxj79FBw2mlJgRzX0eAx\nrJK5LyyxkVshnlX5+tUcUFlq9CFv9epMq5BbxY/CMMHiVJskBn5j6SqLjoCb\ng0kY\r\n=AaY+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICmW8R6u0ddqn/aWBMYFcjLkjt+l6B0DDL5ZtLpRSU9vAiEA2xFI4GyO4CbP+ayRQ4YrwjazKbHjmqeDvb9B8r2IYSk="}]},"_npmUser":{"name":"brunoscopelliti","email":"me@brunoscopelliti.com"},"directories":{},"maintainers":[{"name":"brunoscopelliti","email":"me@brunoscopelliti.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/engine-holdem_1.0.0_1619819637611_0.21345113556005102"},"_hasShrinkwrap":false},"1.0.1":{"name":"@botpoker/engine-holdem","version":"1.0.1","description":"Texas Hold'em poker engine","main":"tournament.js","engines":{"node":">=14.0.0"},"scripts":{"demo":"node demo/live.js --run","demo:debug":"node demo/live.js | node --inspect-brk demo/tournament-debug.js","lint":"eslint tournament.js domain/** engine/** logger/**","test":"npm run lint && jest","test:debug":"node --inspect-brk ./node_modules/jest/bin/jest"},"repository":{"type":"git","url":"git+https://github.com/brunoscopelliti/poker-holdem-engine.git"},"keywords":["poker engine","poker holdem engine","poker","hold'em","poker hold'em","hold'em engine"],"author":{"name":"Bruno Scopelliti"},"license":"MIT","bugs":{"url":"https://github.com/brunoscopelliti/poker-holdem-engine/issues"},"homepage":"https://github.com/brunoscopelliti/poker-holdem-engine","dependencies":{"@botpoker/cards":"^1.0.0","knuth-shuffle":"1.0.8","poker-combinations":"1.2.2","poker-rank":"2.0.2","request":"2.88.2","winston":"3.3.3"},"devDependencies":{"body-parser":"1.19.0","chalk":"4.1.1","eslint":"7.25.0","eslint-config-bruno":"3.0.0","express":"4.17.1","jest":"26.6.3","pre-commit":"1.2.2"},"gitHead":"cad1d11e5d444d72eca67d76bce6bc9b8dc7f579","_id":"@botpoker/engine-holdem@1.0.1","_nodeVersion":"15.9.0","_npmVersion":"7.5.3","dist":{"integrity":"sha512-OsTrfCL6bLTPE0Oj8nqpodlKR1kGOzyg5skxaFROWL3wxyf5DKRN/RCA+jFbWWZMIRy1V/YpRfAMkqzukm6tjQ==","shasum":"ac018b04ec2fce4cdbb41a36eccb1d01136cc5e9","tarball":"https://registry.npmjs.org/@botpoker/engine-holdem/-/engine-holdem-1.0.1.tgz","fileCount":99,"unpackedSize":129320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjPdiCRA9TVsSAnZWagAACVYP/3wD7F1Lh5iunx54QoKq\nJVy42KNrTqntMaykAi7rYXwihOf17gq0dbFMLl45B3PXKFwPKUqUQwpuKXQp\nrdrgZrsGwn0zw/h9LEyrju7MzUQOQ25V02mhd2Et45ojpYhpmNpN8F/mB1e+\nuMSfqbPOV0N0QFulpKmlL5hurzH2BVz8WlO0l0zZDfhbjLX631KrOS8qW8Hd\n8ZRY9pSKx1KrTnW4volsrw9Zi2/VedJ6Ps6yTirAYd8Rn85MpDGjUiEt9xzt\nGF7SD+xl87uTLRbaE8sLH13rcD4T4MU/wopxmpumzNrmBLg2Qcp8Zvzbb0S8\nGlwRNjBNGt5UAeemUyTU1481EE7HvhEZoBkhEB8zsbFqMn540ESP3q/kV5lh\nDq8s10g7e0dVJ/s2PA+telD/V7pJXFMbWzcLl2D3kHjmKfYKPBS2lEv47E1V\n1LmZl4cVTtl0b7NFkLDhwld5EeOFNts/gbF9syCQgGTvGEUo9B9IGtl13f8+\nENtgr8n+bEtGH88y/FjhnxPQSD2s6bqw/pu0Zp/BwBwCWdfWUJZaLFq9+wH8\nfBxuu/qaq+zLTMbDIJrLKEw7XlvDxA+qEgcbAf12Fmy3RQk1jp27t0m0RNmK\nfr14EY5T888X0dpdhJLW3M+7bm+CnKngoCsCEYEVj9eKodQgPEx1zZjkJBTR\nk3IH\r\n=IYU0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFf1JWDex9rUboCR0fBgvqo1MX3Gnxx4ARPbUG5Q0a4wIgYo3RrjCanDR3q3EbKqBzy49tLF0V0kk4+zGDV6WMSwI="}]},"_npmUser":{"name":"brunoscopelliti","email":"me@brunoscopelliti.com"},"directories":{},"maintainers":[{"name":"brunoscopelliti","email":"me@brunoscopelliti.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/engine-holdem_1.0.1_1619851105711_0.0004177478748739194"},"_hasShrinkwrap":false},"1.0.2":{"name":"@botpoker/engine-holdem","version":"1.0.2","description":"Texas Hold'em poker engine","main":"tournament.js","engines":{"node":">=14.0.0"},"scripts":{"demo":"node demo/live.js --run","demo:debug":"node demo/live.js | node --inspect-brk demo/tournament-debug.js","lint":"eslint tournament.js domain/** engine/** logger/**","test":"npm run lint && jest","test:debug":"node --inspect-brk ./node_modules/jest/bin/jest"},"repository":{"type":"git","url":"git+https://github.com/brunoscopelliti/poker-holdem-engine.git"},"keywords":["poker engine","poker holdem engine","poker","hold'em","poker hold'em","hold'em engine"],"author":{"name":"Bruno Scopelliti"},"license":"MIT","bugs":{"url":"https://github.com/brunoscopelliti/poker-holdem-engine/issues"},"homepage":"https://github.com/brunoscopelliti/poker-holdem-engine","dependencies":{"@botpoker/cards":"^1.0.0","@botpoker/rank-hands":"^1.0.0","knuth-shuffle":"1.0.8","poker-combinations":"1.2.2","request":"2.88.2","winston":"3.3.3"},"devDependencies":{"body-parser":"1.19.0","chalk":"4.1.1","eslint":"7.25.0","eslint-config-bruno":"3.0.0","express":"4.17.1","jest":"26.6.3","pre-commit":"1.2.2"},"gitHead":"5e0643a97f801a48822f6e53f5d6e1de17420c09","_id":"@botpoker/engine-holdem@1.0.2","_nodeVersion":"15.9.0","_npmVersion":"7.5.3","dist":{"integrity":"sha512-p0Wz/AiASDUI7KMa5QSPZZrmjN+AD73WhU+k1pwwREMknzOPSbqg05jE/gbgmxmBpoeLb+NuVls8kj0B0x/T5w==","shasum":"f46c99d13b275bfb361bbc1e5e1e9ebe6e8cffa5","tarball":"https://registry.npmjs.org/@botpoker/engine-holdem/-/engine-holdem-1.0.2.tgz","fileCount":99,"unpackedSize":129422,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjln1CRA9TVsSAnZWagAAdeIQAJENzlA1vhOvbPUZnbFM\n3JRn4tn7PmLKxkxvxxTKjS5ZP+qgDrZBw/X0VChybL4J0YLIsOZS5UIsJ742\nuR67ZVvNIhEi4aQjBEEAMpiKJTnw6d/I+7R2BosB5LL6g0WscYKNx5WMNR6k\ncyGnDSJkR2h6eCgBxPugX7tIr/TN33+Ozf3u5F/IMwyUuLye7xvMDCTzt43S\nZQMG1QYkhJ2z4qxYGnSVlJCIzTOwmUitORxiGR6vPdPcpyUS32GTt3p2/6nW\nBTeWmJwlT6brIl6H8a1yL6SG0inmsy0WrGvSDdvXH5ke7ArCK5iz0lRWHjnm\nTF88EudzHwV6zhYHr9U8i7TbVD6EnG6548MCg4C2pKIRiQXfWIsOfCftNNOc\nHMyqbK1vbEzIe8yVoz0jSltW65/Ix5AtYWYNaZJ4L+KTNmBHRB5H4FBVbhOs\nGx0AACZ0EKkdi3Xn8CNkiGY2riTzgeIB8LBjEe1aC9+W56/URBSMr5GNq5kC\nHzV+uvj3tohc+pJlNknZXuonmD6QyH/rwYWyhA3rDFiBabU7xk7Kc42LS8kg\nuP/ziOu3AemZpgJKUcgqvMRSFKzAqR5lOGQRQ4JCSRrOz172sLzo7frN3nkX\nTN5urjRU7hpdOAGoeLGei+ZccObrHRVeLewO6Nh61I+QpdXdmmASIFz3/V4z\n3pbo\r\n=kPzx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9GCDSe4ttWB0zPTlbUSwEy6wOClO6Fp7VXoVXsaAp3wIgHcxMUKKLfVMYT/eyKNCyYCv5qgVDobeyz4y1D777+xE="}]},"_npmUser":{"name":"brunoscopelliti","email":"me@brunoscopelliti.com"},"directories":{},"maintainers":[{"name":"brunoscopelliti","email":"me@brunoscopelliti.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/engine-holdem_1.0.2_1619941876936_0.7446952226288654"},"_hasShrinkwrap":false},"1.0.3":{"name":"@botpoker/engine-holdem","version":"1.0.3","description":"Texas Hold'em poker engine","main":"tournament.js","engines":{"node":">=14.0.0"},"scripts":{"demo":"node demo/live.js --run","demo:debug":"node demo/live.js | node --inspect-brk demo/tournament-debug.js","lint":"eslint tournament.js domain/** engine/** logger/**","test":"npm run lint && jest","test:debug":"node --inspect-brk ./node_modules/jest/bin/jest"},"repository":{"type":"git","url":"git+https://github.com/brunoscopelliti/poker-holdem-engine.git"},"keywords":["poker engine","poker holdem engine","poker","hold'em","poker hold'em","hold'em engine"],"author":{"name":"Bruno Scopelliti"},"license":"MIT","bugs":{"url":"https://github.com/brunoscopelliti/poker-holdem-engine/issues"},"homepage":"https://github.com/brunoscopelliti/poker-holdem-engine","dependencies":{"@botpoker/all-combs":"1.0.0","@botpoker/cards":"1.0.0","@botpoker/rank-hands":"1.0.0","knuth-shuffle":"1.0.8","request":"2.88.2","winston":"3.3.3"},"devDependencies":{"body-parser":"1.19.0","chalk":"4.1.1","eslint":"7.25.0","eslint-config-bruno":"3.0.0","express":"4.17.1","jest":"26.6.3","pre-commit":"1.2.2"},"gitHead":"9ae913ca924f1f2e1b3109f0221d284f5296c93f","_id":"@botpoker/engine-holdem@1.0.3","_nodeVersion":"15.9.0","_npmVersion":"7.5.3","dist":{"integrity":"sha512-9Ty/0EY+z7N2yIwYK8qGvMfQiqGGajNyKyq88fwSrbvIvDsvJYsPvfSbdHNmGxus4bsWe5eifBK6iZiUaBUGEA==","shasum":"997aff7ae0afe90e14cb87d84eba59658b0bd481","tarball":"https://registry.npmjs.org/@botpoker/engine-holdem/-/engine-holdem-1.0.3.tgz","fileCount":99,"unpackedSize":129500,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjqP+CRA9TVsSAnZWagAAeGYQAJmnXW71VzhXlgXYmvPE\nw/iOX0EypweiC9OD2VI226j0ZK6cOuqoFzC4MionMO6QNGMOhrxVMHTLcUbh\nDxx2TSnSeKEPw2la+5Nm13+CJarHYuklejgWB8ZStLbvBbE3E2b98T+9m3eE\noPRd5uzUG0/AZM2FUD8oGnFLgfRP4TcHWSem+rNoQzb5OwzN4m8mDxbSr/1J\n00bnxL/7f6YibY0JsYoFZ7NAuWkPjgKmADFOuqUsRhLZtO6gNGVFjMIMW5WP\nrzypPbJV5hM7AXLcUGFFQmPwJ/LSenbeWNtBw6OaFN1J6ZIMe7FRPGEcitUh\nZyN4TzOh7fGG97metLM7XJOFaVXX1gEA+DT0db72J8tL7xLaQolNMc3ug0UG\ngTjdTw8KV5BK5uACZulf1KzcXleCTwFyyDgo82t+MPcjqJxHkWmVVLZAQA2Y\n4e7caj6OTJq5RhiPs/QuF+7qx+kddMPqcJnx8xtAxgktHImX3LLiCbL5TIIn\nNqkUJx1qlxBwcL4PwLp03xKmfgJylkyVe2sJB1xiHsoYFpqMFr5QXmwbtZ+D\nN1Rx2FkdUey92AaV41O1CqW33pDbJUnVUC4Qfh4zpdSjVnwEciTEMYxdTp23\n+arU/HfC+hPlML49KEAxT6owLxfZFXIor7Nx0+PqKwmTRTYo7xhc6dyxrhS6\niVNO\r\n=4LJY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGaHrBoG+ZXD4PbyPzZI5eBmS5yUc4gvuxyljh6rQ/9OAiAUwjD47BQuelEtE3JgEUMYw5KWXf4hSixMlDKRM20FSA=="}]},"_npmUser":{"name":"brunoscopelliti","email":"me@brunoscopelliti.com"},"directories":{},"maintainers":[{"name":"brunoscopelliti","email":"me@brunoscopelliti.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/engine-holdem_1.0.3_1619960829893_0.8802352538477509"},"_hasShrinkwrap":false}},"time":{"created":"2021-04-30T21:53:57.248Z","1.0.0":"2021-04-30T21:53:57.742Z","modified":"2022-04-04T20:14:27.945Z","1.0.1":"2021-05-01T06:38:25.885Z","1.0.2":"2021-05-02T07:51:17.339Z","1.0.3":"2021-05-02T13:07:10.030Z"},"maintainers":[{"name":"brunoscopelliti","email":"me@brunoscopelliti.com"}],"description":"Texas Hold'em poker engine","homepage":"https://github.com/brunoscopelliti/poker-holdem-engine","keywords":["poker engine","poker holdem engine","poker","hold'em","poker hold'em","hold'em engine"],"repository":{"type":"git","url":"git+https://github.com/brunoscopelliti/poker-holdem-engine.git"},"author":{"name":"Bruno Scopelliti"},"bugs":{"url":"https://github.com/brunoscopelliti/poker-holdem-engine/issues"},"license":"MIT","readme":"# @botpoker/engine-holdem\n\n`@botpoker/engine-holdem` provides an engine to play Texas Hold'em Poker in respect of the [official rules](https://it.wikipedia.org/wiki/Texas_hold_%27em).\n\nPoker here is meant to be played by other programs, which should be listening for POST http request somewhere in the Internet, or on your localhost.\n\nIt's used as default poker holdem engine for http://botpoker.org.\n\n## demo\n\nIt's possible to run a demo on your local machine by executing the `npm run demo` from the project root folder.\n\n## start a tournament\n\n```js\nconst Tournament = require(\"@botpoker/engine-holdem\");\n\nconst tournamentID = \"botparty\";\n\nconst players = [\n  {\n    id: \"r2\",\n    name: \"r2d2\",\n    serviceUrl: \"http://127.0.0.1:8080/\"\n  },\n  ...\n];\n\nconst tournamentSettings = {\n  BUYIN: 100,\n  // Read docs/game-settings.md for the available configuration options.\n};\n\nconst opts = {\n  async onFeed (feed) {},\n  async onGameComplete (chart) {},\n  async onTournamentComplete (data) {},\n};\n\nconst tournament = new Tournament(tournamentID, players, tournamentSettings, opts);\ntournament.start();\n```\n\nPlayers should be object with at least the `name`, `id`, and `serviceUrl` properties specified.\n\nOn the specified end point there should be an http server, responding on the `POST /bet`, `GET /`, and `GET /version` routes.\n\n## quit a tournament\n\n```js\ntournament.quit();\n```\n\n## prepare your player\n\nIt's possible to code your player in whatever language you want.\nIn the following example I will use JavaScript.\n\n```js\n// server.js\n\n\"use strict\";\n\nconst player = require(\"./player\");\n\nconst http = require(\"http\");\nconst express = require(\"express\");\nconst bodyParser = require(\"body-parser\");\n\nconst app = express();\nconst server = http.Server(app);\n\napp.use(bodyParser.json());\n\napp.get(\"/\", function (req, res) {\n  res.sendStatus(200);\n});\n\napp.get(\"/version\", function (req, res) {\n  res.status(200).send(player.VERSION);\n});\n\napp.post(\"/bet\", function (req, res) {\n  res.status(200).send(String(player.bet(req.body)));\n});\n\nconst port = Number.parseInt(process.env[\"PORT\"] || 1337);\n\nserver.listen(port, function () {\n  console.log(\"Server listening on port\", server.address().port);\n});\n```\n\nAnd the player module\n\n```js\nmodule.exports = {\n  VERSION: \"pokerstar v1\",\n  bet (gamestate) {\n    // gamestate contains info about the state of the game;\n    // currently we just fold every single hand.\n    return 0;\n  },\n};\n```\n","readmeFilename":"README.md"}