Targetstart Targetend Sourcestart Sourceend Target Buf
Targetstart Targetend Sourcestart Sourceend Target Buf
console.log(buf1.compare(buf2, 5, 9, 0, 4));
// Prints: 0
console.log(buf1.compare(buf2, 0, 6, 4));
// Prints: -1
console.log(buf1.compare(buf2, 5, 6, 5));
// Prints: 1
console.log(buf2.toString('ascii', 0, 25));
// Prints: !!!!!!!!qrst!!!!!!!!!!!!!
// Create a `Buffer` and copy data from one region to an overlapping region
// within the same `Buffer`.
buf.copy(buf, 0, 4, 10);
console.log(buf.toString());
// Prints: efghijghijklmnopqrstuvwxyz
buf.entries()#
Added in: v1.1.0