101arrowz / fflate

High performance (de)compression in an 8kB package
https://101arrowz.github.io/fflate
MIT License
2.27k stars 79 forks source link

Create zip with empty directory #118

Closed ryanlin1986 closed 2 years ago

ryanlin1986 commented 2 years ago

For example, I just want to create empty directory named test, the following code does not work.

zipSync({
  test: {}
})
101arrowz commented 2 years ago

This is probably something that should be supported for consistency, but you can do this instead:

zipSync({
  'test/': new Uint8Array(0)
})
101arrowz commented 2 years ago

Added support for the original syntax in v0.7.3. Thanks for the feature request!