mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-11 18:50:16 -04:00
The worker now writes files from the registry using the pre-computed
digest from the server, skipping:
- crypto.hash('sha512', buffer) for every file (33K hashes on 287MB)
- statSync to check if file exists first
- temp file + rename for atomic write
Instead, uses writeFileSync with O_CREAT|O_EXCL (flag: 'wx') which
creates the file atomically or fails silently if it already exists.
Also exports contentPathFromHex from @pnpm/store.cafs.
Benchmark: 14.8s (down from 16.2s, baseline 22s)