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

@mcbe-mods/ipc

v1.0.0-beta.6

Published

Inter-Pack Communication system for MCBE Script API

Readme

@mcbe-mods/ipc

npm version npm downloads bundle License

Inter-Pack Communication for Minecraft Bedrock Edition Script API.

Fire-and-forget messaging with automatic chunking and optional pluggable compression.

Install

npm install @mcbe-mods/ipc

Usage

import { EVENTS, IPC } from '@mcbe-mods/ipc'

const ipc = new IPC({ namespace: 'myAddon' })

// Send a message
ipc.send('chat', { text: 'hello', sender: 'alice' })

// Receive messages
ipc.on<{ text: string, sender: string }>('chat', (data) => {
  console.log(data.text)
})

// One-shot (auto-unsubscribes after first message)
ipc.once('greeting', (data) => {
  console.log('First message only:', data.text)
})

// Cancel subscription
const off = ipc.on('channel', handler)
off()

Events

ipc.events.on(EVENTS.ERROR, (err) => {
  console.error('IPC error:', err.message)
})

Lifecycle

ipc.dispose()

Options

interface IPCOptions {
  namespace?: string // default: 'global'
  chunkSize?: number // default: 1800 (max safe bytes per scriptEvent)
  compressThreshold?: number // default: 800 (only compress when payload exceeds this)
  compress?: DataCompressor // pluggable compression (e.g. @mcbe-mods/compress)
  maxPacketSize?: number // default: 1_000_000
  chunkTimeout?: number // default: 30_000 (ms)
  cipher?: ProtocolCipher // transport-layer encryption
}

Compression

Compression is optional and pluggable via the compress option. IPC compares the compressed result length against the original — if shorter, the compressed version is sent with a c flag; the receiver decompresses automatically.

Use the standalone @mcbe-mods/compress package:

import { Compressor } from '@mcbe-mods/compress'

const ipc = new IPC({ compress: new Compressor(), compressThreshold: 500 })

Or provide any custom implementation matching DataCompressor:

const ipc = new IPC({
  compress: {
    compress: s => myPack(s),
    decompress: s => myUnpack(s),
  },
})

Encryption

Transport-layer encryption is optional via the cipher option. All IPC payloads are encrypted before sending and decrypted on receipt.

Use the standalone @mcbe-mods/crypto package:

import { Cipher } from '@mcbe-mods/crypto'
import { IPC } from '@mcbe-mods/ipc'

const cipher = Cipher.fromPassword('my-shared-secret')
const ipc = new IPC({ cipher })

// All messages are automatically encrypted/decrypted
ipc.send('secret-channel', { key: 'value' })
ipc.on('secret-channel', (data) => { /* decrypted */ })

Or provide any ProtocolCipher implementation:

const ipc = new IPC({
  cipher: {
    encrypt(s: string) { return myEncrypt(s) },
    decrypt(s: string) { return myDecrypt(s) },
  },
})

Messages that fail decryption are silently dropped (handled by the underlying Protocol layer).

License

MIT