🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

decmpfs

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

decmpfs

crates.io
Version
0.1.0
Version published
Weekly downloads
771
5.76%
Maintainers
1
Weekly downloads
 
Created
Source

decmpfs

coverage score Socket score

Apply the operating system's transparent per-file filesystem compression to a file — smaller on disk, byte-identical on read, decompressed by the kernel at near-native speed. macOS APFS (decmpfs/LZVN), Linux btrfs (zstd→lzo→zlib), Windows NTFS (LZNT1).

The core does the bytes-to-compressed-file write in one pass — it never writes a file then reads it back to recompress.

use decmpfs::{compress_bytes, compress_file, Gate};

// Write `content` straight to an OS-compressed file (single pass).
let outcome = compress_bytes(path, &content, &Gate::any())?;

// Or compress a file that already exists, in place.
let outcome = compress_file(path)?;

Outcome, never a surprise error

Every call returns an OutcomeCompressed, NoGain (incompressible / sub-cluster), AlreadyCompressed, Unsupported (the FS has no per-file compression — ext4, xfs, ZFS, ReFS, FAT, tmpfs, network mounts), or Skipped (permission, lock, gate). An unsupported filesystem or a permission issue is a non-fatal Outcome, not an Err; Err is reserved for genuine I/O failures.

Gate

Gate decides which files to compress by glob and/or size:

let gate = Gate::new(Some("**/*.node"), Some(">= 1MB"))?;

Codecs (speed over ratio — a file is written once, read on load)

  • macOS: LZVN (the fastest decmpfs codec to decompress).
  • Linux btrfs: zstd, falling back to lzo then zlib on older kernels.
  • Windows NTFS: LZNT1 (survives a reinstall's open-for-write, unlike WOF).

Features

The core is dependency-light (libc / windows-sys only). The optional addon feature pulls zstd + sha2 to unwrap a napi --compress hybrid .node back to the raw addon before compressing.

Node

An N-API binding (writeDecmpfsFile / writeDecmpfsFileSync, fs.writeFile-shaped, atomic by default) lives in node/.

License

MIT

FAQs

Package last updated on 03 Jul 2026

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