cross-platform-sock
Create unix sockets on both unix systems and windows
npm install cross-platform-sock
On unix it'll just use a unix socket and on windows it'll return a pipe name.
Usage
const xsock =const net =const server = netconst sock =xsock
Running the above should print
data: hello unix socket
On all systems.
API
sock = xsock(name)
Create a cross platform socket name.
xsock.unlink(sock, cb)
Unlink a previous socket. Only needed on unix systems. On windows this is just a noop.
License
MIT