node.jsnpmpackage.jsonlts

Which Node version should I use to develop my package?


I'm currently developing my package with Node v12.14.0 on my local machine but a PR I received from Dependabot made me think about how that influences the compatibility of my library.

I'm just looking to know if there's any "standard"/recommended way to handle this, or if I should just decide which works best for me and not worry about that.


Solution

  • There is no "standard" way to handle this. You can put the node version in package.json to define the minimal engine version.

    { "engines" : { "node" : ">=0.12" } }
    

    If you want to make it available for most of the developers, use the active LTS version. Dubnium (v10) is still supported, so you can define it as a minimum requirement to make it available virtually to everyone.