🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

fast-ipc

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-ipc

Fast & simple IPC (Inter-Process Communication) server/client written on native net module

1.0.9
latest
Source
npm
Version published
Weekly downloads
2
-88.24%
Maintainers
1
Weekly downloads
 
Created
Source

fast-ipc

Fast & simple IPC (Inter-Process Communication) server/client build on native net module

Installation

npm i fast-ipc

Usage

Server

import { server } from 'fast-ipc';

const ipcServer =
    new server('example')
        .on('msg', (req) => {
            console.log(req);
            //[1, 2, 3, 4, 5]
        })
        .on('ping', (req, res) => {
            res('pong!');
        })
        .on('event', (req, res) => {
            res({
                data: req,
                timestamp: Date.now()
            });
        });

Client

import { client } from 'fast-ipc';

const ipcClinet = new client('example');

ipcClinet.send('msg', [1, 2, 3, 4, 5]);

ipcClinet.send('ping', [], (msg) => {
    console.log(msg);
    //pong!
});

ipcClinet.send('event', [1, 2, 3, 'testing'], (msg) => {
    console.log(msg);
    //{ data: [ '1', '2', '3', 'testing' ], timestamp: 1577025604487 }
});

Keywords

ipc

FAQs

Package last updated on 21 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts