D
Deno

help

Run examples on Windows

ABAltair 680b2/15/2023
Anyone know how to run the Piping to files example on Windows? https://deno.land/manual@v1.30.3/examples/subprocess 'yes' is ignored, and I get a final error for the kill request
process.kill("SIGINT");
process.kill("SIGINT");
error: Uncaught PermissionDenied: Access is denied. (os error 5) process.kill("SIGINT");
IioB2/15/2023
I believe this api is being deprecated so I think this example should be updated
ABAltair 680b2/15/2023
Will there be any instruction for this example on Windows? What is the replacement for deno.run? Any existing documentation ?
IioB2/15/2023
Deno.Command is the alternative there are docs but it's unstable until next major release (1.31.0)
ABAltair 680b2/15/2023
Thanks <:party_deno:1035517691517218847> I've never used this help before. Can I close this?
IioB2/15/2023
It just stays open but you can rename the title to make it clear you don't still need help though honestly I would avoid doing that until you have whatever you wanted to have working working
ABAltair 680b2/15/2023
Thanks again. For anyone else!
/**
* subprocess_piping_to_file.ts
*/

import { mergeReadableStreams } from "https://deno.land/std@0.177.0/streams/merge_readable_streams.ts";

// create the file to attach the process to
const file = await Deno.open("./process_output.txt", {
read: true,
write: true,
create: true,
});

// start the process
const process = Deno.run({
//
// changed this from ["yes"] to ["cmd", "clear"]
//
cmd: ["cmd", "clear"],
stdout: "piped",
stderr: "piped",
});

// example of combining stdout and stderr while sending to a file
const joined = mergeReadableStreams(
process.stdout.readable,
process.stderr.readable,
);

// returns a promise that resolves when the process is killed/closed
joined.pipeTo(file.writable).then(() => console.log("pipe join done"));

// manually stop process "yes" will never end on its own
setTimeout(() => {

//
// changed this from SIGINT to SIGTERM
//
process.kill("SIGTERM");
process.close()
}, 1000);
/**
* subprocess_piping_to_file.ts
*/

import { mergeReadableStreams } from "https://deno.land/std@0.177.0/streams/merge_readable_streams.ts";

// create the file to attach the process to
const file = await Deno.open("./process_output.txt", {
read: true,
write: true,
create: true,
});

// start the process
const process = Deno.run({
//
// changed this from ["yes"] to ["cmd", "clear"]
//
cmd: ["cmd", "clear"],
stdout: "piped",
stderr: "piped",
});

// example of combining stdout and stderr while sending to a file
const joined = mergeReadableStreams(
process.stdout.readable,
process.stderr.readable,
);

// returns a promise that resolves when the process is killed/closed
joined.pipeTo(file.writable).then(() => console.log("pipe join done"));

// manually stop process "yes" will never end on its own
setTimeout(() => {

//
// changed this from SIGINT to SIGTERM
//
process.kill("SIGTERM");
process.close()
}, 1000);

Looking for more? Join the community!

Recommended Posts
Python alternative to ctypes, can't figure how to convert a codeHello, I am trying to convert a Python ctypes code to Deno using FFI, but can't know why its not woSuggestions for minimal JSX rendering?Any suggestions for rendering jsx to a string (or ideally a stream), in the most minimal manner fromDeno.run Strange IssueI use `Deno.run` + stdout/signals/etc a lot, but this behavior is beyond my current debugging abilitProperly continuously read data from a ReaderWhat's the proper way to continuously read from a `Deno.Reader`? I'm trying to parse incoming HTTP2npm:redis – everything returns `string`?Every command I try to use from `npm:redis` seems to have inferred return type `string`. Look at theMy magic middlewares typeIf anyone wants a typescript challange here is one: I am trying to create a tuple type which containRead one byte at a time from ReadableStreamWhat would be the most obvious way to read a single byte from a ReadableStream at a time?My deno.lock file exceeds 4000 lines of JSON nowIs this common for application projects? Is there any nice way to clean it up?importing packages breaks typesIm importing `Receiver` from https://deno.land/x/upstash_qstash@v0.3.2. but as soon as i import thisBug report: deno.land website returns a 500 error for JS filesOn https://deno.land, I noticed that the Node vs Deno comparison didn't seem to do anything. From Deno stopps at file.read()I am currently working on a way to communicate with a COM device. I can successfully open and read f[Resolved][Fresh] How to load data asynchronously after rendering a page ?Hi ! I was wondering if someone could help me understand the paradigm to load data asynchronously afSupabase Auth UI in FreshI'm building a simple web. I'd like to use Supabase's Auth UI, namely the `Auth` component, for handAny tool that will complie my TS code to JS?I have coded a website in typescript using Deno, but I want to convert it to JS code. I know the DenHow to get remote IP address when using Deno.serve?I'm using connInfo when using Deno from STD but the native http server doesn't seem to have such intTwo questions on documentationRTFM in 3... 2... 🙂 Question 1: How do i hide documentation for specific exports, i do not want Is there any simple way to keep track of the heap/stack usage of a running Deno application?I have made a Deno application and I'm curious to know if there's heap/stack issues that I should fiusing data from one deno bench in anotheris there any good way to re-use the results generated in one deno bench in another one? example: `docker compose up of Oak server throws: SyntaxError: Duplicate export of 'type'I am just learning how to use Docker, and am trying to put up a container of an Oak server. When runPublishing Deno Module with Bin (Answered)I know there's a way to include a `bin/` when publishing a module and then perform some kind of `den