I'm new to Node.js addons, I don't understand the difference between nan
and n-api
.
And is there an easy way to migrate an addon for old version (node v.0) to a newer version (node v.8)?
I'm new to Node.js addons, I don't understand the difference between nan
and n-api
.
And is there an easy way to migrate an addon for old version (node v.0) to a newer version (node v.8)?
n-api
is a new way to create addon independent from the underlying JavaScript runtime (ex V8) and is maintained as part of Node.js.
I think there is no easy way for migration to n-api because it changed almost every interface but I think programming with n-api
is easier than nan
. In n-api
you can use pure C programming and it's new feature. for more example on n-api
you can check here.