table-master-parser
v1.2.10Table Master Parser
The Blue Chip Bridge Table Manager Protocol, allows bridge programs to communicate with each other in order to play bridge. ASCII messages (terminated with a CRLF) are exchanged over TCP/IP.
This package parses the ASCII message and produces a javascript object representation commonly called an Abstract Syntax Tree (AST).
Use the online parser to see the results of parsing a message.
Documentation on each message is automatically produced by this package. The change log is automatically produced with the help of semantic-release.
Getting started
table-master-parser is available for Node.js and most modern browsers. If you want to know if your currrent browser is compatible, run the online test suite.
Install with npm
> npm install table-master-parser --save
Node
Include the package
var tm = require('table-master-parser')
Parse a message
tm.parse('South plays AS', (e, m) => console.log(m)))
Produces
{ kind: 'play',
card: 'AS',
seat: 'S'
}
Browser
Include the package from your project
<script src="./node_modules/table-master-parser/dist/table-master-parser.min.js" type="text/javascript"></script>
or from the unpkg CDN
<script src="https://unpkg.com/table-master-parser/dist/table-master-parser.min.js"></script>
This will provide tableMasterParser
as a global object, or define
it if you are using AMD.
Metadata
- MIT
- Whatever
- Richard Schneider
- released 10/5/2016