@pokerrdev/poker-engine
v1.0.1
Published
High-performance C++ poker game engine with direct Node.js bindings - handle MongoDB IDs in your backend
Maintainers
Readme
@pokerrdev/poker-engine
🚀 High-performance C++ poker engine for Node.js/TypeScript backends
Performance: 11,000+ games/second
Ultra-fast C++ poker engine with direct Node.js bindings.
Installation
npm install @pokerrdev/poker-engineQuick Start
import { PokerEngine } from '@pokerrdev/poker-engine';
const engine = new PokerEngine();
const gameId = engine.createGame(10, 20); // smallBlind, bigBlind
// Add players (no names needed - just ID and chips)
engine.addPlayer(gameId, 1, 1000);
engine.addPlayer(gameId, 2, 1000);
// Start and play
engine.startGame(gameId);
engine.dealHoleCards(gameId);
engine.playerCall(gameId, 1);
engine.playerBet(gameId, 2, 50);API
Game Management
createGame(smallBlind, bigBlind): numberstartGame(gameId): booleanendGame(gameId): void
Players
addPlayer(gameId, playerId, chips): booleanplayerFold(gameId, playerId): booleanplayerCall(gameId, playerId): booleanplayerBet(gameId, playerId, amount): boolean
State
getGameState(gameId): GameStategetCommunityCards(gameId): Card[]
Publishing
Validation
First, validate your package is ready:
npm run validateThis checks:
- ✅ Node.js version (>= 16)
- ✅ NPM login status
- ✅ Required files exist
- ✅ Package configuration
Automated Publishing
Use the included publish script for easy publishing:
# Full automated publish (recommended)
npm run publish:package
# Or simple publish (less checks)
npm run publish:simpleThe automated script will:
- ✅ Check prerequisites (Node.js, npm, login status)
- ✅ Clean previous builds
- ✅ Install dependencies
- ✅ Build C++ addon
- ✅ Run all tests
- ✅ Show package contents
- ✅ Ask for confirmation
- ✅ Publish to NPM
- ✅ Verify publication
Manual Publishing
If you prefer to publish manually:
# Build and test
npm run build
npm test
# Publish
npm publish --access public
# Verify
npm info @pokerrdev/poker-engineLicense
MIT
