A javascript model for contract (duplicate) bridge.
The change log is automatically produced with the help of semantic-release.
bridge.js is available for both node.js and the browser. Most modern browsers are supported. If you want to know if your browser is compatible, run the online test suite.
Install with npm
> npm install bridge.js --save
Include the package
var bridge = require('bridge.js')
Use it to deal a random game
var hands = new bridge.Deck()
.shuffle()
.deal(bridge.seat.west);
console.log(hands.north)
Include the package from your project
<script src="./node_modules/bridge.js/dist/bridge.min.js" type="text/javascript"></script>
or from the unpkg CDN
<script src="https://unpkg.com/bridge.js/dist/bridge.min.js"></script>
This will provide bridge
as a global object, or define
it if you are using AMD.
<script>
var hands = new bridge.Deck()
.shuffle()
.deal(bridge.seat.west);
alert("North's hand " + hands.north);
</script>