createLayerFromFs
createLayerFromFs(
fs,parent,command?):Promise<Layer>
Defined in: packages/core/src/kernel/layer.ts:455
Build a Layer object from a frozen memoryFS.
Parameters
Section titled “Parameters”Frozen memoryFS holding the layer’s diff content.
parent
Section titled “parent”string | undefined
Parent layer id, or undefined for the base layer.
command?
Section titled “command?”string
Optional build command that produced this layer.
Returns
Section titled “Returns”Promise<Layer>
A fully-populated Layer.
Remarks
Section titled “Remarks”Computes content hash and size in parallel, derives the chain-aware id
via chainAwareId, and stamps created with Date.now(). The
returned layer is ready to hand to LayerStore.put. Shared by the
builder’s .run() path and container commit.
Example
Section titled “Example”import { createLayerFromFs, createLayerStore } from '@fishnet/core'
const store = createLayerStore()const layer = await createLayerFromFs(frozenFs, undefined, 'echo base')store.put(layer)