Filesystem Module

Archive & Compression

Enterprise-grade compression and archiving executing entirely within the XHSC core. These operations eliminate Node.js buffer overhead, providing zero-copy performance for massive data structures.

Lossless Compression (GZIP)

Efficient file compression and decompression using native Go implementations.

.compress(src, dest)

Compresses a file to .gz format.

.decompress(src, dest)

Restores a compressed .gz file.

typescript
__sys__.fs.compress("data.json", "data.json.gz");
__sys__.fs.decompress("data.json.gz", "data.restored.json");

TAR Archiving

Bundle entire directory trees into a single archive or extract them with metadata preservation.

Archiving

.tar(dir, output)

Recursively bundles a directory.

Extraction

.untar(archive, dest)

Extracts an archive to a destination.

typescript
__sys__.fs.tar("./src", "src_backup.tar");
__sys__.fs.untar("src_backup.tar", "./restore");
File Watching

Monitor filesystem events reactively and trigger automated processes.