computeLayerSize
computeLayerSize(
fs):Promise<number>
Defined in: packages/core/src/kernel/layer.ts:318
Compute total byte size of all files in a frozen memoryFS (the diff content).
Parameters
Section titled “Parameters”Frozen memoryFS whose content should be measured.
Returns
Section titled “Returns”Promise<number>
Total bytes across all non-whiteout files.
Remarks
Section titled “Remarks”Recursively sums Stat.size for every file reachable from the FS root.
Whiteouts are skipped — they carry no content. This is what populates
Layer.size during createLayerFromFs.
Example
Section titled “Example”import { computeLayerSize } from '@fishnet/core'
const bytes = await computeLayerSize(frozenFs)console.log(`layer diff: ${bytes} bytes`)