Development0 views

Node.js 26.8.0 adds native ZIP file support without external libraries

Node.js 26.8.0 introduces a built-in API for working with ZIP files directly through the node:zlib module, eliminating the need for external packages for common compression tasks. The update adds three new classes: ZipBuffer, ZipFile, and ZipEntry, giving developers native tools to read, create, and manipulate ZIP archives.

ZipBuffer lets you load a ZIP from memory (Buffer, TypedArray, DataView, or ArrayBuffer), iterate through stored files, check their size and content, add new entries, and remove items. The implementation uses a zero-copy approach, maintaining a view of the original data and reading each entry's content only when needed—reducing unnecessary memory copies.

For files on disk, ZipFile provides random access to entries and lazy reading, so you don't load the entire archive into memory at once. The API supports creating new archives, working with streams, generating a new Buffer with toBuffer(), and automatic Zip64 support when needed. This simplifies code for applications that handle file uploads, generate compressed packages, or process ZIP documents.

Keep in mind that this feature is marked as Stability: 1.0—still in initial development—and triggers an experimental warning when used. The documentation also notes that protection against path traversal attacks like Zip Slip remains the developer's responsibility.