bun
bun copied to clipboard
Buffer implementation inconsistent with NodeJS - Bun outputs array buffer
.toString implementation is seems flawed or at least inconsistent with NodeJS:
Test.ts
import { readFileSync } from 'fs'
const completePath = './data'
const data = readFileSync(completePath).toString()
console.log({ data: data.toString() })
Outputs:
⋊> ts-node ./test.ts
{ data: 'data' }
⋊> bun test.ts
{ data: "100,97,116,97" }
⋊> npx tsc test.ts
⋊> node test.js
{ data: 'data' }
#155
Yes we will fix this, tracking the issue in #155