fontello / svg2ttf

SVG -> TTF font convertor
MIT License
518 stars 79 forks source link

Node 10 emits deprecation notice of `new Buffer()` #78

Closed gregjacobs closed 5 years ago

gregjacobs commented 5 years ago

Node 10 emits a warning to stderr when running svg2ttf about the Buffer constructor being deprecated:

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

I normally would say that this is not a big issue, but it actually causes our Rush build to be "successful with warnings" because of the write to stderr, which prevents Rush from doing an incremental build on that package because of the warnings. Also, it will likely cause the the rush build command to exit with a non-zero exit code in the next major version.

I can pipe the stderr output to stdout, but that's hacky and results in legitimate errors not being collated and reported by Rush's summary reporting mechanism (it collates everything from stderr for all packages' builds in the monorepo when there are errors)

Seems like a quick change from new Buffer() to Buffer.from() in svg2ttf.js?

varna commented 5 years ago

Sounds like a major release where microbuffer library is replaced with a native Buffer