Node.js native extension vs pure js module

I am writing a new component node.js. I am writing this from scratch - no existing assets for reuse. What are some of the considerations for building your own extension compared to a pure js module?

+3
source share
1 answer

You should try to write pure js modules. Firstly, they are much easier to write and maintain. Secondly, they are cross-platform. Thirdly, I think this is also very important, you probably will not have memory leaks when writing extensions in pure javascript.

When you have finished a pure javascript implementation and performance is desired / OK, I don’t think you should write your own extension. Try this only when performance is lower.

I also believe that they are changing the complete infrastructure to write their own extension and will use gyp instead ?

+2
source

All Articles