lino-levan / astral

A high-level puppeteer/playwright-like library for Deno
https://jsr.io/@astral/astral
MIT License
248 stars 17 forks source link

Download progress should be printed to stderr #102

Closed lowlighter closed 2 weeks ago

lowlighter commented 2 weeks ago

I've already opened an upstream issue about the progress bar lib used (https://github.com/deno-library/progress/issues/30)

The advantage of printing to stderr is that you can use $() (which does not capture stderr) to resolve the allow run path ahead and ensure your actual script only execute with limited permissions:

deno run --allow-run=$(deno eval 'console.log(await import("jsr:@astral/astral").then(_ => _.getBinary("chrome")))') mod.ts

Some other linux command also do this, like wget:

wget https://example.com > /dev/null
--2024-10-30 01:48:05--  https://example.com/
Resolving example.com (example.com)... 93.184.215.14, 2606:2800:21f:cb07:6820:80da:af6b:8b2c
Connecting to example.com (example.com)|93.184.215.14|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1256 (1.2K) [text/html]
Saving to: ‘index.html’

index.html                      100%[=======================================================>]   1.23K  --.-KB/s    in 0s      

2024-10-30 01:48:05 (110 MB/s) - ‘index.html’ saved [1256/1256]
lino-levan commented 2 weeks ago

Sure, that makes sense. I'm supportive. Thanks for opening the issue upstream.