Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function tick () {
if (stop) return
let nodeId = `1:${ ++index }`
let connection = new WsConnection('ws://localhost:31337', WebSocket)
let log = new Log({ nodeId, store: new MemoryStore() })
let node = new ClientNode(nodeId, log, connection, {
credentials: 'secret',
subprotocol: '1.0.0',
outMap: map
})
node.on('clientError', e => {
stop = true
throw e
})
node.catch(e => {
stop = true
throw e
})
node.connection.connect()
await node.waitFor('synchronized')