3

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)?

hippietrail
  • 15,848
  • 18
  • 99
  • 158
Idkingz
  • 31
  • 1

1 Answers1

2

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.

Parham Alvani
  • 2,305
  • 2
  • 14
  • 25