Socket
Book a DemoInstallSign in
Socket

bare-ipc

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bare-ipc

Lightweight pipe-based IPC for Bare

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
2
Created
Source

bare-ipc

Lightweight pipe-based IPC for Bare.

npm i bare-ipc

API

IPC

const [portA, portB] = IPC.open(opts)

Returns a pair of IPCPorts for use constructing the IPC duplex stream based on bare-pipe.

const ipc = new IPC(port)

Returns a duplex stream using the provided port. See streamx's Duplex for Duplex API.

ipc.ref()

Increase the reference count for the IPC to keep the event loop alive.

A common pattern is to ipc.ref() on Bare.on('resume') and ipc.unref() on suspend like so:

Bare.on('suspend', () => ipc.unref()).on('resume', () => ipc.ref())

ipc.unref()

Decrease the reference count for the IPC to allow the event loop to exit.

See ipc.ref() for common pattern to keep the event loop alive.

IPCPort

const port = new IPCPort(incoming, outgoing)

The arguments are:

  • incoming is the read file handle
  • outgoing is the write file handle

port.connect()

Returns an IPC connected to the port.

port.detached

A boolean for whether the port is detached.

License

Apache-2.0

FAQs

Package last updated on 16 Apr 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