Perf: speed up text line stream

This commit is contained in:
SukkaW
2024-10-08 21:00:49 +08:00
parent de9429ce92
commit 14ed4c01e5
3 changed files with 11 additions and 9 deletions

View File

@@ -10,6 +10,7 @@ import { processLine } from './process-line';
const getReadableStream = (file: string | FileHandle): ReadableStream => {
if (typeof file === 'string') {
// return fs.openAsBlob(file).then(blob => blob.stream())
return Readable.toWeb(fs.createReadStream(file/* , { encoding: 'utf-8' } */));
}
return file.readableWebStream();