nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨
https://nodejs.org
Other
104.75k stars 28.29k forks source link

Async brotli decompress-compress #53025

Open Mrgaton opened 4 weeks ago

Mrgaton commented 4 weeks ago

What is the problem this feature will solve?

I dont want to use util promisfy for using brotli as async

What is the feature you are proposing to solve the problem?

zlib.brotliCompressAsync

What alternatives have you considered?

No response

RedYetiDev commented 4 weeks ago

Just curious, but what's wrong with the util.promisify way?

Mrgaton commented 4 weeks ago

i just ugly having to declare each function separatly and having to import another lib to the code

Mrgaton commented 4 weeks ago

im referring to brotli but it would also be good for gzip, deflate, etc.

marco-ippolito commented 4 weeks ago

like for fs and timers, ideally, you should be able to require zlib/promises. However it has not been implemented yet and zlib doesnt have promise based apis

Mrgaton commented 4 weeks ago

Yes but why are they not inside zlib? Its just confusing

Mrgaton commented 4 weeks ago

image also i get an error

marco-ippolito commented 4 weeks ago

image also i get an error

For other api like fs we ship the promise based version in fs/promises. In case of zlib this has not been done, if someone is interested in implementing it I wouldnt object

RedYetiDev commented 4 weeks ago

Should I add "help wanted" for someone to take on the issue?

(ping) @nodejs/zlib in case they are already on the case

Mrgaton commented 4 weeks ago

so this feature will actualy will be shiped to node?

Mrgaton commented 4 weeks ago

Member

but why dont just make their async function inside zlib 🙄

RedYetiDev commented 4 weeks ago

so this feature will actualy will be shiped to node?

It's possible, but someone would have to implement it, so that takes time and energy.

Mrgaton commented 4 weeks ago

Could you do it for me

RedYetiDev commented 4 weeks ago

I'm not an expert on ZLIB (or even a novice), but someone will likely implement it eventually. However, it will take time, so I wouldn't expect it anytime soon.