Add createClient (#61)
* Initial commit * remove comment * export obj * fix export * add to api.md * fix old refs to nmp
This commit is contained in:
parent
0bf6b8bded
commit
d8ff48258c
4 changed files with 72 additions and 1 deletions
9
examples/createClientExample.js
Normal file
9
examples/createClientExample.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
const { createClient } = require('bedrock-protocol')
|
||||
|
||||
const client = createClient({ hostname: '127.0.0.1' })
|
||||
|
||||
let ix = 0
|
||||
client.on('packet', (args) => {
|
||||
console.log(`Packet ${ix} recieved`)
|
||||
ix++
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue