auth0 / node-jwa

JSON Web Algorithms
http://tools.ietf.org/id/draft-ietf-jose-json-web-algorithms-08.html
MIT License
99 stars 41 forks source link

use Buffer.from() and Buffer.alloc() (DeprecationWarning in node 7.0.0) #18

Closed ralphtheninja closed 7 years ago

ralphtheninja commented 7 years ago

Gets rid of the following:

DeprecationWarning: Using Buffer without `new` will soon stop working.
Use `new Buffer()`, or preferably `Buffer.from()`, `Buffer.allocUnsafe()` or 
`Buffer.alloc()` instead.
ralphtheninja commented 7 years ago

Hmm. Obviously this is not supported in older versions of node.

ralphtheninja commented 7 years ago

@brianloveswords Maybe we should remove 0.10 from .travis to start with? Since maintenance ends on October 31st.

ralphtheninja commented 7 years ago

Updated PR. Using safe-buffer module for supporting older versions of node. Thanks @mafintosh for the tip :)