You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it would convenient if this lib supports this approach from the box:
constzip=newfflate.ZipSync();zip.add({filename: "image.png",data: imgData,// `ArrayBuffer`/`TypedArray`});zip.add({filename: "docs/text.txt",data: "The example text"// `String`, just use `new TextEncoder().encode(data)` in this casemtime: newDate("2022-12-22 12:15:00")});/** @type {Uint8Array} */constzipBytes=zip.end();
fflate's philosophy is to avoid validating or checking input and to not allow shorthands except where it yields no impact on bundle size, so this is not going to be implemented.
However, I am currently working on ezzip, an fflate wrapper with convenience features like these and modern APIs. I will take this feature request into consideration there and update here once it's published.
Activity
101arrowz commentedon May 21, 2022
fflate's philosophy is to avoid validating or checking input and to not allow shorthands except where it yields no impact on bundle size, so this is not going to be implemented.However, I am currently working on
ezzip, anfflatewrapper with convenience features like these and modern APIs. I will take this feature request into consideration there and update here once it's published.AlttiRi commentedon Jun 13, 2022
Also a wrapper for zipping a directory with a few lines of codes would be useful for Node.js.
Something like this: