@deno/eszip

中文文档
0.106.0发布于 2025/12/09MITES Module近 30 天下载 6.8万

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

原始使用文档
文档目录6 节
  1. Examples
  2. Creating an eszip
  3. Viewing the contents of an eszip
  4. Loading the eszip into V8
  5. File format
  6. Development

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

版本与发布记录

@deno/eszip 共发布 106 个版本,首次发布于 2022/02/22;过去 12 个月发布了 2 个版本。

版本发布日期距今
0.106.0latest2025/12/0911 个月前
0.105.02025/11/2811 个月前
0.104.02025/10/181.1 年前
0.103.02025/10/141.1 年前
0.99.02025/08/301.2 年前
0.98.02025/08/261.2 年前

关于 @deno/eszip 的常见问题

@deno/eszip 是什么?

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

如何安装 @deno/eszip?

在项目目录运行 npm install @deno/eszip,或使用 pnpm add / yarn add / bun add。

@deno/eszip 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/deno__eszip 是否存在。

@deno/eszip 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@deno/eszip 可以商用吗?

@deno/eszip 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@deno/eszip 的下载量有多少?

根据 npm 官方下载统计,@deno/eszip 在 2026/10/12 – 2026/11/10 这 30 天内被下载 68,465 次,日均约 2,282 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@deno/eszip 还在维护吗?

最新版本 0.106.0 发布于 2025/12/09(11 个月前);至今共发布 106 个版本,其中过去 12 个月发布了 2 个;首次发布于 2022/02/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。