Seeking help migrating from Deno.run to Deno.Command with spawn
I have this code
3 Replies
The issue I am having is that I cannot decode
p.stdout
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the code snippet you've provided, I noticed a potential issue that you might want to address.
In the main code section, you are using
p.output.bind(p)
as a promise for the withTimeout
function. However, p.output
is not a function but a property that returns a Deno.Reader
. You should be using p.output()
to get the output as a promise. Since p.output
is not a function, calling bind
on it will not work as expected.
Here's the corrected line:
Please note that this advice is not based on the Deno documentation, and I advise you to double-check the accuracy of the advice given. If you continue to experience issues, you may want to consider reaching out to the Deno community or reviewing the Deno documentation for further guidance.Helpful Links:
Deno 1.20 Release Notes
Deno 1.17 Release Notes
/async/mod.ts | std@0.207.0 | Deno
Deno 1.19 Release Notes
Deno 1.34: deno compile supports npm packages
Deno 1.29: Custom npm registry support
Runtime APIs
Deno 1.44: Private npm registries, improved Node.js compat, and performance boosts
p.stdout
is a ReadableStream. your options are either using p.output()
instead of p.status
, or use streaming capabilities, but since you seem to want to collect the output to a single string, probably the first solution is the best for you