UNPKG

netdde

Version:

A JavaScript implementation of the NetDDE protocol

21 lines (16 loc) 681 B
//@ts-check const NetDDEClient = require('../../src/client/client'); const C = require('../../src/constants'); const logProm = p => p.then(d => console.log(d)).catch(e => console.log('ERR:', e)); let c = new NetDDEClient('EXCEL', { host: '192.168.15.101' }); c.on('error', d => console.log('#ERROR', d)); c.on('close', d => console.log('#CLOSE', d)); c.on('advise', d => console.log('#ADVISE', d)); c.on('topic_disconnect', d => console.log('#TOPIC_DISCONNECT', d)); async function test() { console.log(await c.connect()); console.log(await c.request('PROGMAN', 'Accessories')); setTimeout(() => c.disconnect(), 1000); } //test(); //c.request('PROGMAN', 'Startup')