This package is a simple IPC implementation between Node and its child process (Golang binary) using the stdin / stdout as the transport.
- Installation
npm install ipc-node-go
#or
yarn add ipc-node-go
- Useage
constIPC=require('ipc-node-go')//orimportIPCfrom'ipc-node-go'constipc=newIPC('path-to-golang-bin')// start the child processletarg=['some-flags','or-anything']ipc.init(arg)// send a message to go processipc.send('start-service',true)//listen for and eventipc.on('service-ready',someData=>{console.log(someData)})// send and get an acknoledgement via a callbackipc.sendAndReceive('get-service-info',{id: 1},(error,data)=>{// do whatever you want})IPC is an EventEmitter.
MIT License