pierreinglebert / node-zopfli

Node bindings for Zopfli Compression Algorithm (zlib, gzip, deflate compatible)
MIT License
110 stars 39 forks source link

N-API support for node-zopfli #92

Closed digitalinfinity closed 5 years ago

digitalinfinity commented 6 years ago

Node 8 has a new experimental feature called N-API which is aimed at reducing maintenance cost for node native addons. Check out this blog for more details on its benefits.

node-zopfli is a popular module, and in order to help the Node.js community make the important transition to N-API, we are hoping you will be able to work with us in order to migrate node-zopfli to N-API. Your support and feedback is important in making this effort a success.

We (N-API team) have built a preliminary port of node-zopfli on top of N-API as part of our effort to understand the API surface used by native modules. We used this port and the port of some other modules to determine which areas to focus on converting to N-API. This port has all of the NAN code removed and replaced by N-API equivalents. While it passes all the node-zopfli unit tests, it might need a bit more refinement before getting merged in. Please take a look if you're interested. I will be happy to answer questions about the port, point to documentation/code, etc. I'm also happy to open a PR if you're happy with the port in it's current shape.

If you like, you can join our WG meeting which happens every Thursday at 1:30 Eastern / 10:30 Pacific US time, to discuss any issues or ask us any questions.

If you don't want to take a dependency on a feature that still has "experimental" status, we understand, and a good option might be to maintain a branch that uses N-API, that is kept mostly up to date with development occurring in node-zopfli/master. We have some precedence to follow with node.bcrypt.js which recently published a N-API version of their module. Of course we'd appreciate feedback about anything we can do to improve the development or migration experience.

pierreinglebert commented 5 years ago

Thank you for your work, it really helped me switch to N-API, something I really wanted to try.