Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

buffer-equals

sindresorhus258.7kMITdeprecated2.0.0

Just use Buffer#equals(). It has been available since Node.js 0.12.

Node.js 0.12 buffer.equals() ponyfill

builtin, core, ponyfill, polyfill, shim, buffer, buffers, equals, equal, compare, comparison

readme

buffer-equals Build Status

Node.js buffer.equals() ponyfill

Deprecated: Just use Buffer#equals(). It has been available since Node.js 0.12.

Install

$ npm install --save buffer-equals

Usage

const bufferEquals = require('buffer-equals');

bufferEquals(new Buffer('foo'), new Buffer('foo'));
//=> true

bufferEquals(new Buffer('foo'), new Buffer('bar'));
//=> false

API

See the buffer.equals() docs.

The only difference is that you pass in the buffer as the first argument instead of calling the .equals() method on the buffer instance.

License

MIT © Sindre Sorhus