miickel / gulp-angular-templatecache

Concatenates and registers AngularJS templates in the $templateCache.
MIT License
524 stars 103 forks source link

Buffer() is deprecated due to security issues. #173

Closed simonua closed 5 years ago

simonua commented 5 years ago

The code (in one instance) and the tests (in many instances) use Buffer(), which has been deprecated in NodeJS 6.0.0:

(node:12056) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

Replace Buffer() with Buffer.from, which was added in NodeJS 5.10.0. All versions prior to 6, and, within days, 6 as well, are already deprecated, so this should be a benign, non-breaking change; however, package.json still shows support for 4.2.0.

Maybe the approach should be to wait a couple more days until NodeJS 6 is deprecated, then update the minimum version to NodeJS 8 (EOL end of 2019) and perhaps issue a major version change.