Open this example in the interactive library
Source code
import { Buffer } from "node:buffer";
console.log(Buffer.from([254, 255]).readInt16LE());
Sample output
-2

Open this example in the interactive library
import { Buffer } from "node:buffer";
console.log(Buffer.from([254, 255]).readInt16LE());
-2