New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

ipc-dialog

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ipc-dialog

Lightweight IPC library for Node.js with bidirectional request-response pattern and optional timeout management

latest
npmnpm
Version
1.3.1
Version published
Maintainers
1
Created
Source

IPC Request System

Lightweight IPC library for Node.js with bidirectional request-response pattern and optional timeout management.

Features

  • Bidirectional request-response (parent ↔ worker)
  • Optional adaptive timeout with ping extension
  • Fire-and-forget messaging
  • TypeScript support

Installation

npm install ipc-dialog

Quick Start

Parent:

import { fork } from 'child_process';
import { IPCWrapper } from 'ipc-dialog';

const worker = new IPCWrapper(fork('./worker.js'));
const result = await worker.request('task', { value: 42 });
console.log(result); // { result: 84 }

Worker:

import { IPCResponder } from 'ipc-dialog';

const responder = new IPCResponder(process);
responder.onRequest('task', async (data) => {
    return { result: data.value * 2 };
});

Worker → Parent:

import { IPCWrapper, IPCResponder } from 'ipc-dialog';

// In worker: send request to parent
const parent = new IPCWrapper(process);
const data = await parent.request('getData', { id: 123 });

// In parent: handle requests from worker
const parentResponder = new IPCResponder(worker);
parentResponder.onRequest('getData', (data) => {
    return { data: [1, 2, 3] };
});

API

IPCWrapper

new IPCWrapper(process: IPCProcess, options?: {
    id?: string;                        // default: 'NOID'
    adaptiveTimeoutMs?: number | null;  // null/Infinity = infinite
    hardTimeoutMs?: number | null;      // null/Infinity = infinite
})

request<T>(type, data?, options?): Promise<T>
send(message)
message(type, data?)
process: T  // Full access to ChildProcess/Worker methods
id: string  // Always set (default: 'NOID')

IPCResponder

new IPCResponder(process: IPCProcess, options?: {
    pingIntervalMs?: number | null;  // null/0 = disable
})

onRequest(type, handler: (data: any) => any)
onMessage(type, handler: (data: any) => any)
offRequest(type)
offMessage(type)
process: T  // The process being listened to

// Tip: Type your data inline: handler: (data: YourInterface) => ...

Types

import type { IPCMessage, IPCProcess, IPCWrapperOptions, IPCResponderOptions } from 'ipc-dialog';

License

ISC © tish

Keywords

ipc

FAQs

Package last updated on 25 Nov 2025

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