#Property 'fromWeb' does not exist on type 'typeof Readable'.

1 messages · Page 1 of 1 (latest)

crisp belfry
#

bun-types : 0.6.7
bun version: 0.6.7

#
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

fast helm
#

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