csjh
csjh
DDeno
Created by csjh on 5/1/2024 in #help
Using `Deno.FsFile.prototype.readable` with `Response`
I was trying to stream a file into a response with the snippet:
const file = await Deno.open(path);
const resp = new Response(file.readable);
file.close();
return resp;
const file = await Deno.open(path);
const resp = new Response(file.readable);
file.close();
return resp;
but it throws a BadResource error. This makes sense, because closing the file would destroy the associated stream, but if I have to close the file at some point, how can I put it in a Response? afaict any way I do it will either error or leave a leak. I guess I could add a finalizer for the file but that seems silly.
9 replies
DDeno
Created by csjh on 9/3/2023 in #help
DuckDB deno package broken & npm package segfaulting
Has anyone had any luck using DuckDB with Deno? I've tried with the npm package with segfaults on a basic test query, and with the denoland package with fails on initialization (which is especially unfortunate because it was made by one of the deno maintainers? oh well).
6 replies