I’m writing a new node.js component. I write it from scratch – no existing assets to reuse. What are some of the considerations for building a native extension vs. a pure js module?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should try to write pure js modules. First they are a lot easier to write and maintain. Second they are cross-platform. Third, which I think is also pretty important you will probably have no memory leaks when you write your extensions in pure javascript.
When you have finished the pure javascript implementation and the performance is desired/OK I don’t think you should write native extension. Only try this when the performance is subpar.
Also I believe they are changing the complete infrastructure to write native extension and will use gyp instead?