#Property 'fromWeb' does not exist on type 'typeof Readable'.
1 messages · Page 1 of 1 (latest)
import readline from 'readline'
import { Readable } from 'node:stream'
const secretsFile = Readable.fromWeb(Bun.file('example.txt').stream())
const rl = readline.createInterface({
input: secretsFile,
crlfDelay: Infinity
})
rl.on('line', (line) => {
console.log(line);
})
example code
theres two bugs here
one is a typedef bug. gonna open a fix for that in a little bit
but secondly the readline polyfill doesnt play well with Readable streams as input, but it works with fs.createReadStream
@crisp belfry this issue covers the bug you're facing https://github.com/oven-sh/bun/issues/2596