From b97741c0bbf1ea321eb4271d1be59598c8d87fc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20Lund=C3=A9n?= Date: Fri, 11 Nov 2016 11:19:22 +0100 Subject: [PATCH] Using new Buffer() instead of just Buffer() From Node 7 onwards you get this message: DeprecationWarning: Using Buffer without `new` will soon stop working. Use `new Buffer()`, or preferably `Buffer.from()`, `Buffer.allocUnsafe()` or `Buffer.alloc()` instead. Should probably be Buffer.from() but it's only available from Node 5, if that's important. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index f4f7474..cea0c89 100644 --- a/index.js +++ b/index.js @@ -282,7 +282,7 @@ function encode(channelData, opts) { u32(buffer.byteLength - 44); lookup(data_encoders, bitDepth, floatingPoint)(buffer, pos, channelData, channels, samples); - return Buffer(buffer); + return new Buffer(buffer); } module.exports = {