bcoin-org / bcrypto

JS crypto library
Other
99 stars 41 forks source link

Switch to N-API and deprecate NAN #38

Closed braydonf closed 4 years ago

braydonf commented 4 years ago

Is the use of NAN still necessary with N-API?

The bdb package does not depend on NAN with the use of N-API.

chjj commented 4 years ago

It would be really nice to get away from NAN, but it seems like it would be a huge rewrite. I think it might be extra difficult since it may be hard to do incrementally (?).

braydonf commented 4 years ago

Yeah, all of ./src/ would need to be updated to use N-API patterns instead of NAN. This may be able to be done per module, however once new pattern established it'll likely be quicker to update the others.

braydonf commented 4 years ago

Related pull request for libsecp256k1 bindings https://github.com/cryptocoinjs/secp256k1-node/pull/160

braydonf commented 4 years ago

Looks like this has been implemented on the master branch now (nan is no longer a dependency).