Kill Deno.Command

Is it possible to kill/end a Deno.command-instance? Example code:
(async () => {
let ffmpegProcess: Promise<Deno.CommandOutput> | undefined;
ffmpegProcess = new Deno.Command("ffmpeg", {args: ["-i", filename, `${folder}/frame%08d.png`, "-threads", "1"]}).output();
await ffmpegProcess;
done = true;
})();

// Later some time
ffmpegProcess.close(); // Something like that?
(async () => {
let ffmpegProcess: Promise<Deno.CommandOutput> | undefined;
ffmpegProcess = new Deno.Command("ffmpeg", {args: ["-i", filename, `${folder}/frame%08d.png`, "-threads", "1"]}).output();
await ffmpegProcess;
done = true;
})();

// Later some time
ffmpegProcess.close(); // Something like that?
C
crowlKats30d ago
command.kill
D
DNA30d ago
No description
D
DNA30d ago
Not an option
C
crowlKats30d ago
ah, you are using .output(). to do more manual things, you need to use .child().
D
DNA30d ago
That works, thanks How can i wait for that command to finish though?
M
Mrcool30d ago
const process = new Deno.Command("ls").spawn()
// kill -> process.kill()
// wait -> await process.status
const process = new Deno.Command("ls").spawn()
// kill -> process.kill()
// wait -> await process.status
D
DNA29d ago
That works Thank you very much
More Posts
Bundle ts code to ts using deno emitWhen bundling code using https://deno.land/x/emit@0.38.2 it bundles into javascript but i want it toCant find name 'Deno'I want to use Deno in my type script program but when I try to use Deno it says "Cant find name 'Denrequest bodyyo. how to read request body if it's node:http server? rq.body is undefined rq.read() returns null OpenTelemetry instrumentationDid anyone have some luck making OpenTelemetry instrumentation libraries work on Deno? I've seen sImport package from Azure DevOps repositoryHi ! 👋 I'm trying to import a private package from Azure DevOps Git repository. I can't make it wHelp with deploymentHow to use Tailwind css plugins in FRESH?is it possible to use tailwind css plugins in Fresh project? if it is, how?What am I missing when conditionally styling SVGsSo I have a SVG of an arrow that only has a stroke color. I want to change this stroke color based oError in npm package - how to squelch?I'm using an npm package that I think isn't being processed for Deno correctly. I get this error: `Is there a way to handle subpath imports within a library?I'm trying to convert a library package to work with deno. Internally, the package makes a bunch ofHow to connect to a MySQL 5.0.24?I was trying to use mysql@v2.12.1 to connect to a MySQL 5.0.24 Server but it is not compatible, is tTips for deploying Deno locally?Do we have a best practice for this? I want to deploy to my LAN only for a particular site. Maybe juHow to know when a Deno.Conn is closedA `Deno.Conn` is created either with `Deno.connectTls` or `Deno.connect`. How do we detect when the readFile path not foundI'm trying to use Deno.readFile but when is execute i get an error about wrong path. The files are Is there a way to read big files using something like .seek but with ending position as well?So, I'm doing a version of the billion line challenge in JS. I've already implemented a version withesbuild-deno-loader with npm private registryDid anyone used the esbuild-deno-loader with npm: specifier while using a private npm registry that how to load env variables from .env file in taskthe `source` shell command is not available. I tried ``` "tasks": { "my-task": "export .env &&Is there a way to specify a range and list from KV?```typescript const kv = await Deno.openKv(); kv.set(["parent", 1], "key1") kv.set(["parent", 2], "kPermissionDenied while using ioredis npm packageHello, I'm facing an issue with an npm library ioredis (https://github.com/redis/ioredis). For someIs there a way to obtain Deno.cron schedule info?Deploy lists the registered cron jobs with name, schedule, last run and next run. Is there a program