#deno #zip #module #graphs #content #single-file #serialization #esm #javascript

eszip

A utility that can download JavaScript and TypeScript module graphs and store them locally in a special zip file

141 releases (breaking)

Uses new Rust 2024

new 0.109.0 Feb 2, 2026
0.107.0 Jan 17, 2026
0.106.0 Dec 8, 2025
0.105.0 Nov 27, 2025
0.7.0 Mar 31, 2021

#140 in Compression

Download history 1574/week @ 2025-10-19 3268/week @ 2025-10-26 1865/week @ 2025-11-02 2476/week @ 2025-11-09 2573/week @ 2025-11-16 3922/week @ 2025-11-23 3083/week @ 2025-11-30 4010/week @ 2025-12-07 4396/week @ 2025-12-14 1235/week @ 2025-12-21 1702/week @ 2025-12-28 2632/week @ 2026-01-04 3195/week @ 2026-01-11 4318/week @ 2026-01-18 3597/week @ 2026-01-25 5544/week @ 2026-02-01

16,916 downloads per month
Used in 12 crates (10 directly)

MIT license

190KB
5K SLoC

Rust 4.5K SLoC // 0.0% comments TypeScript 539 SLoC // 0.1% comments TSX 15 SLoC JavaScript 5 SLoC

eszip

The eszip format lets you losslessly serialize an ECMAScript module graph (represented by deno_graph::ModuleGraph) into a single compact file.

The eszip file format is designed to be compact and streaming capable. This allows for efficient loading of large ECMAScript module graphs.

https://eszip-viewer.deno.dev/ is a tool for inspecting eszip files.

Examples

Creating an eszip

cargo run --example eszip_builder https://deno.land/std/http/file_server.ts file_server.eszip2

Viewing the contents of an eszip

cargo run --example eszip_viewer file_server.eszip2

Loading the eszip into V8

cargo run --example eszip_load file_server.eszip2 https://deno.land/std/http/file_server.ts

File format

The file format looks as follows:

Eszip:
| Magic (8) | Header size (4) | Header (n) | Header hash (32) | Sources size (4) | Sources (n) | SourceMaps size (4) | SourceMaps (n) |

Header:
( | Specifier size (4) | Specifier (n) | Entry type (1) | Entry (n) | )*

Entry (redirect):
| Specifier size (4) | Specifier (n) |

Entry (module):
| Source offset (4) | Source size (4) | SourceMap offset (4) | SourceMap size (4) | Module type (1) |

Sources:
( | Source (n) | Hash (32) | )*

SourceMaps:
( | SourceMap (n) | Hash (32) | )*

There is one optimization for empty source / source map entries. If both the offset and size are set to 0, no entry and no hash is present in the data sections for that module.

Development

When opening a PR make sure to rebuild Wasm by running:

deno task build

Dependencies

~35–53MB
~811K SLoC