Javascript uses only 64 bit double precision floats. To read a long number you have to read two 32 bit integers and shift the high 32 bits to the left. Also note that there possibly is an information loss for long values not in the range of 9007199254740992 <= x <= -9007199254740992 since the internal representation uses 1 bit for the sign and 11 bits for the exponent.
Since the low part can be negative but must be treated as unsigned, a correction is added.
function readInt64BEasFloat(buffer, offset) {
var low = readInt32BE(buffer, offset + 4);
var n = readInt32BE(buffer, offset) * 4294967296.0 + low;
if (low < 0) n += 4294967296;
return n;
}