LoadedDescriptor
A descriptor loaded (and cached) by a BundleSource.
A descriptor loaded (and cached) by a BundleSource.
Holds the parsed header/index together with the filepath it was loaded from, so reading entry data always targets the exact bundle version that produced this descriptor — even if the source's active version is swapped concurrently.
The instance owns a reference-counted handle to the cached descriptor. When the
JavaScript object is garbage-collected, the handle is released automatically; the
underlying descriptor stays alive only while the source cache (see
BundleSource.loadDescriptor) or another LoadedDescriptor references it.
No manual disposal is required and no memory is leaked.
Constructor
new LoadedDescriptor();Methods
Prop
Type
Examples
descriptor
const loaded = await source.loadDescriptor('app');
const index = loaded.descriptor().index();
console.log(index.containsPath('/index.html'));getData
const loaded = await source.loadDescriptor('app');
const html = await loaded.getData('/index.html');
if (html) {
console.log(html.toString('utf-8'));
}