demo_met_buffer_allocunsafe_fill.js:
var buf = Buffer.allocUnsafe(15); /*The value of an unsafe buffer is not emptied, and can contain data from older buffers:*/ console.log(buf); /*Empty the buffer:*/ buf.fill(0); /*The buffer is now zero-filled:*/ console.log(buf);
C:\Users\My Name>node demo_met_buffer_allocunsafe_fill.js
<Buffer 02 00 00 00 a7 01 00 00 10 53 49 90 02 a7 01>
<Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00>