Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pipe script into deno run

Tags:

deno

I have an executable that generates javascript that I'd like to pipe into deno run, however the run subcommand only seems to take a script path as an argument, and doesn't support the usual convention of - to read from stdin.

Workarounds that I'm aware of but not satisfied with:

  • Save script in a temporary file, and feed it into deno run
  • Pipe script into deno repl (this prints a bunch of repl garbage along with the desired script output)
  • Use deno eval (my generated javascript is large... feels icky to provide as a command line argument)
like image 559
Tom Avatar asked Jul 28 '26 04:07

Tom


1 Answers

Now you can use the following syntax:

cat file.js | deno run -

If you need permissions:

cat file.js | deno run --allow-all -
like image 132
Marcos Casagrande Avatar answered Aug 02 '26 20:08

Marcos Casagrande



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!