import { Socket } from '../src' const USOCKET = __dirname + '/sample.sock' ; (async () => { class Test extends Socket { constructor(opts) { super(opts) } async _packetProcess(packet) { console.log('packet being processed') console.dir(packet) if (packet.cmd) return await this[packet.cmd](packet.data,packet.name) return {error: 'no command in packet', packet: packet } } async doit(data,name) { let res = {} console.log('data:', data) res.status ='success' res.name = name res.cmd = 'reply' res.data = 'this might be response data from another process' return(res) } } let test = new Test({path:USOCKET}) await test.create() })().catch(err => { console.error('FATAL: UNABLE TO START SYSTEM!\n',err) })