
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
fuse-block-device
Advanced tools
A virtual block device backed by FUSE
npm install fuse-block-device
const blockDevice = require('fuse-block-device')
const device = blockDevice('./mnt/4gb', {
read (index, blocks, buffer, cb) {
// Read {blocks} x 512 blocks into {buffer} from some storage
cb(null)
},
write (index, blocks, buffer, cb) {
// Store {blocks} x 512 from {buffer} into some storage
cb(null)
}
})
You can use a block device to create various file systems on top.
Try running the example from the repo (that implements an in-memory block device) and make an ext4 file system on top:
# cd fuse-block-device
node example.js
# in another shell in the same folder
mkfs.ext4 ./mnt/4gb # creates an ext4 file system on the block device \o/
const device = blockDevice(mountPoint, [options])Create a new virtual block device.
Options include
{
size: fixedFixedOfTheDevice, // must be divisable by 512
read: (index, blockCount, buffer, cb), // called when the device wants to read blocks
write: (index, blockCount, buffer, cb), // called when the device wants to write blocks
mount: (), // called when the device is fully mounted
error: (err), // called if the device experienced an error during mount
uid: process.getuid(), // optionally set the uid of the block device
gid: process.getgid(), // optionally set the gid of the block device
options: [ ... ], // fuse mount options that are forwarded
}
Each stored block is 512 bytes, but note that your write/read method might be called with more than one block at the time.
device.close([callback])Fully close the block device. You should call this before shutting down the program to nicely unmount it first.
device.open([callback])Optionally you can call this to be notificed when the device is mounted.
MIT
FAQs
A virtual block device backed by FUSE
We found that fuse-block-device 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.
Did you know?

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.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.