Scan your whole stack
Are you using sabcom?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.1.224
sabcom was last scanned on 26 Nov 2026 at version 0.1.224. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.1.224 LATEST | 26 Nov 2026 | No rules fired |
| 0.1.223 | 25 Nov 2026 | No rules fired |
| 0.1.222 | 24 Nov 2026 | No rules fired |
| 0.1.221 | 23 Nov 2026 | Not shown |
| 0.1.219 | 17 Nov 2026 | Not shown |
Findings for v0.1.224. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.1.224; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
High-performance inter-thread communication using SharedArrayBuffer with atomic operations. Bidirectional channels with synchronous and asynchronous APIs. Faster than postMessage structured clone and transfer.
sabcom is a ring-buffer protocol over SharedArrayBuffer. It handles:
sabcom does NOT:
worker_threads or new Worker())workerData or postMessage)Uint8Array before calling write, e.g., with TextEncoder or JSON.stringify)write/read (non-blocking) and writeSync/readSync (blocking)npm install sabcom
worker.ts
import { workerData } from 'worker_threads';
import { open } from 'sabcom';
const ch = open(workerData as SharedArrayBuffer);
const data = ch.readSync();
const message = new TextDecoder().decode(data);
console.log('Worker received:', message);
ch.writeSync(new TextEncoder().encode(message.toUpperCase()));
ch.close();
main.ts
import { Worker } from 'worker_threads';
import { createBuffer, open } from 'sabcom';
const buffer = createBuffer(65536);
const worker = new Worker('./worker.js', { workerData: buffer });
const ch = open(buffer);
const text = 'Hello from the main thread!';
await ch.write(new TextEncoder().encode(text));
const reply = await ch.read();
console.log('Reply:', new TextDecoder().decode(reply));
ch.close();
await worker.terminate();
createBuffer(byteLength: number): SharedArrayBufferCreates and initializes a SharedArrayBuffer for use as a channel. byteLength must be a multiple of 4 and at least 4096.
open(buffer: SharedArrayBuffer): ChannelOpens a channel on the buffer. Two endpoints can open the same buffer (one per thread). Returns the same handle if called twice in the same thread.
reset(buffer: SharedArrayBuffer): voidResets a closed buffer so it can be reopened. Both endpoints must be closed first.
interface Channel {
write(data: Uint8Array, options?: Options): Promise<void>;
read(options?: Options): Promise<Uint8Array>;
writeSync(data: Uint8Array, options?: Options): void;
readSync(options?: Options): Uint8Array;
close(): void;
}
write / writeSync - send data to the peer endpointread / readSync - receive data from the peer endpointclose - close this endpoint and notify the peerinterface Options {
timeout?: number; // milliseconds, default: 5000
}
When a message fits in a single ring segment and does not wrap the ring boundary, readSync and read return a Uint8Array view directly into the SharedArrayBuffer - no allocation or copy. The view is valid until the next method call on the same channel (read, readSync, write, writeSync, or close). After that, the underlying memory may be overwritten by the peer.
If you need to keep the data beyond the next call, copy it:
const view = ch.readSync();
const copy = view.slice(); // safe to hold indefinitely
Messages that wrap the ring boundary or span multiple segments return an owned copy automatically.
The buffer is split into two ring directions (one per endpoint). Each direction contains control metadata, message descriptors, and a data ring. Larger buffers allocate more data ring space.
Each worker needs its own SharedArrayBuffer. A single buffer supports exactly two endpoints.
import { Worker } from 'worker_threads';
import { createBuffer, open } from 'sabcom';
async function spawnWorker(task: string) {
const buffer = createBuffer(65536);
const worker = new Worker('./worker.js', { workerData: buffer });
const ch = open(buffer);
ch.writeSync(new TextEncoder().encode(task));
const result = await ch.read();
ch.close();
await worker.terminate();
return new TextDecoder().decode(result);
}
const results = await Promise.all([
spawnWorker('task-a'),
spawnWorker('task-b'),
spawnWorker('task-c'),
]);
sabcom transfers raw bytes. Serialize before sending:
const obj = { hello: 'world', count: 42 };
ch.writeSync(new TextEncoder().encode(JSON.stringify(obj)));
const data = ch.readSync();
const parsed = JSON.parse(new TextDecoder().decode(data));
Yes, with Web Workers. SharedArrayBuffer requires cross-origin isolation headers:
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp
Yes. After both endpoints close, call reset(buffer) and reopen:
ch.close();
// ... peer also closes ...
reset(buffer);
const ch2 = open(buffer);
Or pass the buffer to new workers - open auto-resets buffers where both endpoints have closed.
try {
ch.writeSync(data, { timeout: 5000 });
} catch (err) {
if (err.message.includes('timeout')) {
console.error('Peer did not respond in time');
} else if (err.message.includes('closed')) {
console.error('Peer closed the channel');
}
}
pnpm install
pnpm build
pnpm test
pnpm bench
Apache-2.0 (c) Ivan Zakharchanka
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.