Subprocess

can someone help me how do i get to show Hello world in my terminal by using Deno.Commands () using echo
N
NDH42d ago
For Windows. You need to execute. echo from a command processor -- "cmd"
const command = new Deno.Command("cmd", {
args: ["/c", "echo","hello world"],
stdin: "piped",
stdout: "piped"
}).spawn();

let result = await command.output();
const textDecoder = new TextDecoder();
console.log(textDecoder.decode(result.stdout));
const command = new Deno.Command("cmd", {
args: ["/c", "echo","hello world"],
stdin: "piped",
stdout: "piped"
}).spawn();

let result = await command.output();
const textDecoder = new TextDecoder();
console.log(textDecoder.decode(result.stdout));
S
Shadow42d ago
@Altair 680b i am quite new to this . could you help me with one last doubt i have i want to npm init (for example ) in the current working directory
N
NDH42d ago
FYI many linux commands are just executables. In Windows, they are methods of the command processor. I was unable to spawn 'npm' Not sure why. Try asking the #Deno AI Helper
S
Shadow42d ago
i tried using , ls , pwd in
args: ["/c", "ls"],
args: ["/c", "ls"],
'ls' is not recognized as an internal or external command, operable program or batch file. @Deno AI Helper
N
NDH42d ago
Also, you may want to try DAX -- written by a Deno core team member. https://github.com/dsherret/dax
S
Shadow42d ago
Thanks alot mate
N
NDH42d ago
@Deno AI Helper any help with this?
S
Shadow42d ago
ill experiment with it and if i hit a block i believe you are here for me then
More Posts
Problems using @apple/app-store-server-library, how do I debug?Hi, I'm attempting to build out the backend of an IOS app on Supabase and want to be able to verifyIs there an easy way to read tls certificate and key from a filesystem?I do the following: ```js if (Deno.env.has("TLS_CERT_PATH") && Deno.env.has("TLS_PKEY_PATH")) { coPartials in a redirect ???Does anyone have any idea how i can redirect after login to a route with initialised partial: ExamHow to troubleshoot runaway (100% CPU) deno processDeno has been running a couple of websites rock solid for many months. But during last week or so I'Import SCSS in TS filesHey, I am currently building a template for web development and I want to use ESBuild as a bundler. How to modify HTTP cache folderHello, I'm using Astro framework with Deno and Directus, but after a while of the website running onDeno deployment can't connect to the Mongo Cloud, due to the Mongo Cloud Network Access Rules.Is there a way to add the Deno Deploy IP to Mongo Cloud? The Deno Depoy Regions only region names fIs there a way to pull a module from x in favour of jsr?I have ported my module `@vicary/fresh-graphql` to JSR and I would like to redirect my users go JSR In-Source Testing with deno test?Can I do something like [vitest's In-Source Testing](https://vitest.dev/guide/in-source.html) with `How to use vendoring with node_modulesAs trying to recreate a `DENO_DIR` via `deno cache` creates different results on different machines,Make an image cropper that crops from data uriHow to make an image cropper that crops to the given dimensionsBest practice for releasing a deno package on GitHubIs there a best practice for the release process of a Deno library on GitHub? I use semantic-releasedeno oak : howto force reply immediatly, and process the request later ?Bonjour, My server needs to reply an ACK (200 OK) for each request. If it did not, the client dies. Rust: Unable to bootstrap MainWorkerMy message was too long, moved it to a GitHub discussion: https://github.com/denoland/deno/discussioTailwindCSS: Class-Strings build with variablesSince TailwindCSS does not support classes with variables (like I used before with twind), how wouldImport path autocomplete doesn't workHi 👋 It behaves like it's just a string and not an import path. I have the latest version of Deno aDeno: How to import npm scoped packages with @ in deno?I am trying to import @whiskeysockets/baileys in deno like this: import * as a from "npm:@whiskeysoTo avoide tariling slash in URL on deno deployWe have used deno deploy to build website done using Astro frame work (Astrowind Theme)in productioImporting internal modulesI would like to use https://github.com/denoland/deno/blob/main/ext/console/01_console.js in my code,Strange error after lint in github actionsfor a some reason after: ```yml - name: Run linter run: deno lint ``` I get error that says