
Security News
Free Certified Patch for Critical Rails Active Storage Vulnerability
Socket has released a free Certified Patch for a critical Rails Active Storage vulnerability, giving developers time to upgrade to a secure Rails version.
@zenfs/port
Advanced tools
ZenFS backend for usage with ports and workers.
Please read the ZenFS documentation!
For more information, see the docs.
npm install @zenfs/port
[!NOTE] The examples are written in ESM. If you are using CJS, you can
requirethe package. If in a browser you can add a script tag to your HTML pointing to thebrowser.min.jsand use ZenFS Port via the globalZenFS_Portobject.
Main:
import { configure } from '@zenfs/core';
import { Port } from '@zenfs/port';
import { Worker } from 'node:worker_threads';
const worker = new Worker('worker.js');
await configure({
'/worker': {
backend: Port,
port: worker,
},
});
Worker:
import { InMemory, resolveMountConfig } from '@zenfs/core';
import { attachFS } from '@zenfs/port';
import { parentPort } from 'node:worker_threads';
const tmpfs = await resolveMountConfig({ backend: InMemory, name: 'tmp' });
attachFS(parentPort, tmpfs);
If you are using using web workers, you would use self instead of importing parentPort in the worker, and would not need to import Worker in the main thread.
import { InMemory, fs, resolveMountConfig } from '@zenfs/core';
import { Port, attachFS } from '@zenfs/port';
import { MessageChannel } from 'node:worker_threads';
const { port1, port2 } = new MessageChannel();
const tmpfs = await resolveMountConfig({ backend: InMemory, name: 'tmp' });
attachFS(port2, tmpfs);
fs.mount('/port', await resolveMountConfig({ backend: Port, port: port1 }));
console.log('/port');
const content = 'FS is in a port';
await fs.promises.writeFile('/port/test', content);
fs.readFileSync('/tmp/test', 'utf8'); // FS is in a port
await fs.promises.readFile('/port/test', 'utf8'); // FS is in a port
FAQs
Port backend for ZenFS
The npm package @zenfs/port receives a total of 0 weekly downloads. As such, @zenfs/port popularity was classified as not popular.
We found that @zenfs/port demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Socket has released a free Certified Patch for a critical Rails Active Storage vulnerability, giving developers time to upgrade to a secure Rails version.

Security News
/Threat Research
A malicious Ruby gem runs a credential-stealing worm during installation, poisons AI coding tools, and can wipe files when a stolen GitHub token is revoked.

Security News
GitHub is tightening GitHub Actions security with new restrictions on privileged pull request workflows. Here's what changes and how maintainers are affected.