import { decodePackage, encodePackage } from '@datamoc/mwg/mwl';
const bytes = await encodePackage([{ path: 'content.mwl', data: new TextEncoder().encode('[]') }]);
const decoded = await decodePackage(bytes, { maxEntries: 8 });
console.log(decoded.files.map((file) => file.path)); // ['content.mwl']
Reads a
.mwp. Every entry is inflated within its declared size and matched to its SHA-256 before anything is returned; any problem throws aPackageErrorsubclass and no partial content escapes.