bakkerthehacker / bramqp

A radical, raw, robust, remarkable, rapid AMQP library for node.js
MIT License
162 stars 20 forks source link

[DEP0005] DeprecationWarning: Buffer() is deprecated #58

Closed dex4er closed 6 years ago

dex4er commented 6 years ago

Hi. With Node v10.1.0:

$ NODE_OPTIONS='--throw-deprecation' npm test

> bramqp@0.5.0 test /Users/dexter/src/js/bramqp
> vows --spec

  ♢ concurrent connections

events.js:167
      throw er; // Unhandled 'error' event
      ^

DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
    at showFlaggedDeprecation (buffer.js:159:11)
    at new Buffer (buffer.js:174:3)
    at FrameParser.resetFrameState (/Users/dexter/src/js/bramqp/lib/frameParser.js:285:26)
    at new FrameParser (/Users/dexter/src/js/bramqp/lib/frameParser.js:25:7)
    at /Users/dexter/src/js/bramqp/lib/connectionHandle.js:17:22
    at /Users/dexter/src/js/bramqp/lib/specification.js:57:5
    at Parser.<anonymous> (/Users/dexter/src/js/bramqp/node_modules/xml2js/lib/parser.js:303:18)
    at Parser.emit (events.js:182:13)
    at Parser.options.Emitter.emit (/Users/dexter/src/js/bramqp/node_modules/vows/lib/vows.js:241:24)
    at SAXParser.onclosetag (/Users/dexter/src/js/bramqp/node_modules/xml2js/lib/parser.js:261:26)
Emitted 'error' event at:
    at Parser.exports.Parser.Parser.parseString (/Users/dexter/src/js/bramqp/node_modules/xml2js/lib/parser.js:326:16)
    at Parser.parseString (/Users/dexter/src/js/bramqp/node_modules/xml2js/lib/parser.js:5:59)
    at /Users/dexter/src/js/bramqp/lib/specification.js:43:17
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:422:3)
npm ERR! Test failed.  See above for more details.
bakkerthehacker commented 6 years ago

This has been fixed in commit 24b57426 and pushed in version 0.6.0

In order to accommodate the newer Buffer api, many older node versions were dropped as part of this change.