{"name":"Node-ipc","tagline":"Inter Process Communication Module for node using Unix sockets and servers. Giving lightning speed by bypassing the network card for local sockets and ipc.","body":"#node-ipc\r\n*a nodejs module for local and remote Inter Process Communication* for Linux, Mac and Windows.\r\n\r\n**npm install node-ipc** \r\n[![alt node-ipc npm details](https://nodei.co/npm/node-ipc.png?stars=true \"node-ipc npm module details \")](https://npmjs.org/package/event-pubsub \"node-ipc details from npm\")\r\n\r\nPackage details websites :\r\n* [GitHub.io site](http://riaevangelist.github.io/node-ipc/ \"node-ipc documentation\"). A prettier version of this site.\r\n* [NPM Module](https://www.npmjs.org/package/node-ipc \"node-ipc npm module\"). The npm page for the node-ipc module.\r\n\r\n\r\n\r\n----\r\n#### Types of IPC Sockets\r\n\r\n| Type | Stability |Definition |\r\n|-----------|-----------|-----------|\r\n|Unix Socket| Stable | Gives Linux and Mac lightning fast communication and avoids the network card to reduce overhead and latency. [Local Unix Socket examples ](https://github.com/RIAEvangelist/node-ipc/tree/master/example/unixSocket/ \"Unix Socket Node IPC examples\") |\r\n|TCP Socket | Stable | Gives the most reliable communication across the network. Can be used for local IPC as well, but is slower than #1's Unix Socket Implementation because TCP sockets go through the network card while Unix Sockets do not. [Local or remote network TCP Socket examples ](https://github.com/RIAEvangelist/node-ipc/tree/master/example/TCPSocket/ \"TCP Socket Node IPC examples\") |\r\n|TLS Socket | Alpha | ***coming soon...*** |\r\n|UDP Sockets| Stable | Gives the **fastest network communication**. UDP is less reliable but much faster than TCP. It is best used for streaming non critical data like sound, video, or multiplayer game data as it can drop packets depending on network connectivity and other factors. UDP can be used for local IPC as well, but is slower than #1's Unix Socket Implementation because UDP sockets go through the network card while Unix Sockets do not. [Local or remote network UDP Socket examples ](https://github.com/RIAEvangelist/node-ipc/tree/master/example/UDPSocket/ \"UDP Socket Node IPC examples\")|\r\n\r\n|OS|SupportedSockets|\r\n|-----|--------------------|\r\n|Linux|Unix,TCP,TLS,UDP|\r\n|Mac|Unix,TCP,TLS,UDP|\r\n|Win|TCP,TLS,UDP|\r\n\r\n**Windows**usersmaywanttouseUDPserversforthefastestlocalIPC.UnixServersarethefastestopriononLinuxandMac,butnotavailableforwindows.\r\n\r\n----\r\n\r\n####IPCMethods\r\nThesemethodsareavailableintheIPCScope.\r\n\r\n----\r\n#####log\r\n\r\n``ipc.log(a,b,c,d,e...);``\r\n\r\nipc.logwillacceptanynumberofargumentsandif``ipc.config.silent``isnotset,itwillconcatthemallwithasinclespace''betweenthemandthenlogthemtotheconsole.Thisisfastbecauseitpreventsanyconcationfromhappeningiftheipcissettosilent.Thatwayifyouleaveyourlogginginplaceitshouldnoteffectperformance.\r\n\r\nthelogalsosupports[colors](https://github.com/Marak/colors.js) implementation. All of the available styles are supported and the theme styles are as follows :\r\n\r\n {\r\n good : 'green',\r\n notice : 'yellow',\r\n warn : 'red',\r\n error : 'redBG',\r\n debug : 'magenta',\r\n variable: 'cyan',\r\n data : 'blue'\r\n } \r\n\r\nYou can override any of these settings by requireing colors and setting the theme as follows :\r\n\r\n var colors=require('colors');\r\n \r\n colors.setTheme(\r\n {\r\n good : 'zebra',\r\n notice : 'redBG',\r\n ...\r\n } \r\n );\r\n----\r\n##### connectTo\r\n\r\n``ipc.connectTo(id,path,callback);`` \r\n\r\nUsed for connecting as a client to local Unix Sockets. ***This is the fastst way for processes on the same machine to communicate*** because it bypasses the network card which TCP and UDP