--snapshot-blob=path


稳定性: 1 - 实验性

当与 --build-snapshot 一起使用时,--snapshot-blob 指定生成的快照二进制文件的写入路径。如果未指定,生成的二进制文件将写入当前工作目录下的 snapshot.blob

【When used with --build-snapshot, --snapshot-blob specifies the path where the generated snapshot blob is written to. If not specified, the generated blob is written to snapshot.blob in the current working directory.】

当不使用 --build-snapshot 时,--snapshot-blob 指定用于恢复应用状态的 blob 的路径。

【When used without --build-snapshot, --snapshot-blob specifies the path to the blob that is used to restore the application state.】

加载快照时,Node.js 检查:

【When loading a snapshot, Node.js checks that:】

  1. 正在运行的 Node.js 二进制文件的版本、架构和平台与生成快照的二进制文件完全相同。
  2. V8 标志和 CPU 特性与生成快照的二进制文件兼容。

如果它们不匹配,Node.js 将拒绝加载快照并以状态码 1 退出。

【If they don't match, Node.js refuses to load the snapshot and exits with status code 1.】