Wednesday, 15 March 2017

Specify nodejs version in package.json file to make sure not use deprecated API

I use Buffer.from() instead of the deprecated new Buffer() constructor in my project and want to specify node version in package.json.

As far as I know, Buffer.from() is not introduced in lower minor version of some major version of node.js. For example, v5.1.0 does not support Buffer.from but v5.10.0 does.

My question is: I want to specify the node version from major version v4, but it would not be correct to specify like >= 4.5.0.

So, how to specify node version from v4 and make sure support Buffer.from().

Thanks.



via Jeff

No comments:

Post a Comment