thriftrw / thriftrw-node

A thrift binary encoding library using bufrw
MIT License
57 stars 25 forks source link

Address Node.js Buffer constructor deprecations #176

Closed kriskowal closed 4 years ago

kriskowal commented 4 years ago

Node.js deprecated the overloaded Buffer constructor in favor of Buffer.from and Buffer.alloc. This change introduces a convention that allows ThriftRW to continue using old patterns when run under old versions of Node.js, while avoiding the deprecation warnings on modern runtimes.

Avoid global Buffer lint directive. This is consistently elsewhere addressed by expressly importing the shimmable buffer module.