Packs files into one .mwp. It refuses what decodePackage would refuse, so a package that was written can be read back under the same limits.
.mwp
decodePackage
import { decodePackage, encodePackage } from '@datamoc/mwg/mwl';const text = new TextEncoder().encode('[]');const bytes = await encodePackage([{ path: 'content.mwl', data: text }]);console.log((await decodePackage(bytes)).main); // 'content.mwl' Copy
import { decodePackage, encodePackage } from '@datamoc/mwg/mwl';const text = new TextEncoder().encode('[]');const bytes = await encodePackage([{ path: 'content.mwl', data: text }]);console.log((await decodePackage(bytes)).main); // 'content.mwl'
Packs files into one
.mwp. It refuses whatdecodePackagewould refuse, so a package that was written can be read back under the same limits.