goshippo / shippo-node-client

Shipping API Node.js library (USPS, FedEx, UPS and more)
https://goshippo.com/docs
MIT License
136 stars 54 forks source link

Buffer() is deprecated #93

Open brendanjhoffman opened 1 year ago

brendanjhoffman commented 1 year ago

Making a request shows console error (node:2036) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. Buffer() is being used on shippo\lib\Resource.js:183 - var requestData = new Buffer(JSON.stringify(data || {})); Changing the line to var requestData = Buffer.alloc(JSON.stringify(data || {})); makes the error go away.