npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nest-ipc

v0.0.4

Published

NestJS Microservice adapter for IPC

Readme

Nest IPC

Communicate over IPC using NestJS, server and client support.

Uses the custom transports API, so it can be registered as a microservice in NestJS.

Install

npm i nest-ipc

Getting started

Import the IpcModule in your AppModule. The only required config property is id.

import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { IpcModule } from "nest-ipc";

@Module({
  imports: [IpcModule.register({ id: 'world' })],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}

Client

Use the IPC client service in your application using dependency injection.

import { IpcService } from "nest-ipc";
import { firstValueFrom } from "rxjs";

@Controller()
export class AppController {
  constructor(private readonly ipcService: IpcService) {}

  @Post()
  broadcastHello(): void {
    this.ipcService.emit('message', 'hello');
  }
  
  @Get()
  getOverIpc(): Promise<string> {
    return firstValueFrom(this.ipcService.send('message', 'ping'));
  }
}

Server

Register the IPC server as a microservice in your main.ts. We get the IpcServer from the IpcModule, this is why we do app.get(IpcServer).

import { NestFactory } from "@nestjs/core";
import { AppModule } from './app.module';
import { MicroserviceOptions } from "@nestjs/microservices";
import { IpcServer } from "nest-ipc";

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  app.connectMicroservice<MicroserviceOptions>({
    strategy: app.get(IpcServer),
  });
  await app.startAllMicroservices();
  await app.listen(3000);
}
bootstrap();

Listen for messages in your controller.

import { Controller } from "@nestjs/common";
import { Payload } from "@nestjs/microservices";
import { SubscribeIpcMessage } from "nest-ipc";

@Controller()
export class AppController {
  
  @SubscribeIpcMessage('world')
  handleWorldMessage(@Payload() data: string) {
    console.log(data);
  }
}

Or hook into lifecycle events of the IPC server.

import { Controller } from "@nestjs/common";
import { NestIpcServer, OnIpcDisconnect, OnIpcInit } from "nest-ipc";
import { Socket } from "net";

@Controller()
export class AppController implements OnIpcInit, OnIpcDisconnect{

  onIpcDisconnect(socket: Socket): void {
    console.log('IPC client disconnected');
  }

  onIpcInit(server: NestIpcServer): any {
    console.log('IPC server started');
    server.broadcast('message', 'server started');
  }
}

Options

The IpcModule accepts lots of options to customize the client or server. For more information about the configuration options, please see node-ipc.

export interface IpcModuleOptions {
  id: string;
  appspace?: string;
  socketRoot?: string;
  networkHost?: string;
  networkPort?: number;
  readableAll?: boolean;
  writableAll?: boolean;
  maxConnections?: number;
  encoding?: 'ascii' | 'utf8' | 'utf16le' | 'ucs2' | 'base64' | 'hex',
  rawBuffer?: boolean;
  delimiter?: string;
  silent?: boolean;
  unlink?: boolean;
  retry?: number;
  maxRetries?: boolean | number;
  stopRetrying?: boolean;
  interfaces?: {
    localAddress?: boolean | undefined;
    localPort?: boolean | undefined;
    family?: boolean | undefined;
    hints?: boolean | undefined;
    lookup?: boolean | undefined;
  };
}

Security notice

This package uses RIAEvangelist's node-ipc as dependency. The node-ipc package used to include protestware. This protestware would add a file to your desktop and print a heart in the console, in some other versions it would delete files.

The version of node-ipc that this package uses is locked to a non-impacted version (12.0.0) and overriden in package.json to prevent any accidents.