# 04 · snapshot-vs-live **演示**:ESM 的 `count` 是活绑定(`after` 变成 1);CJS 解构出的 `snapshot` 是值快照(仍是 0)。 **运行**:在 `tutorials/typescript` 下执行 `npm run build`,再执行 `npm run serve`,打开 `http://localhost:8080/examples/21-commonjs-snapshot/04-snapshot-vs-live/`;开 Console。 **预期控制台输出**: ```text before:0 after:1 ``` **类型检查**:`node node_modules/typescript/bin/tsc -p examples/21-commonjs-snapshot/04-snapshot-vs-live/tsconfig.types.json` **注意**:CJS 的 `counter.count` 通过 getter 读当前值;一旦赋给变量,就固定为当时的值。