unstorage
unstorage copied to clipboard
Supporting compression
Hey all 👋🏻
Right now I am using unstorage and deal with files that are >= 10MB. I realized that they'd be ideal for compression and was wondering if it'd make sense to have a built-in compression handling. The major would be to keep that universal, but having it for fs only would suffice too from my POV.
Similar to overlay, we can use a compressed driver that wraps another storage instance. (it can be Node.js only for beginning)
storage.mount(compressed(fs({ base: '...' })), { level: 9 })
(Related: https://github.com/unjs/unstorage/issues/23)