JCMais / node-libcurl

libcurl bindings for Node.js
https://npmjs.org/package/node-libcurl
MIT License
666 stars 118 forks source link

How to not show download in stdout/stderr? #348

Closed MikeOBarometer closed 8 months ago

MikeOBarometer commented 2 years ago

When downloading files via the library I see progress printed to terminal when I would not have expected it to, is there a way to disable these?

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1180k  100 1180k    0     0   587k      0  0:00:02  0:00:02 --:--:--  588k  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Curren
MikeOBarometer commented 2 years ago

This occurs in stream mode as the NOPROGRESS opt is explicitly set to false here: https://github.com/JCMais/node-libcurl/blob/f88792dd196c0267a3b7cc889b24cb6902e1a3d9/lib/Curl.ts#L740

A workaround here is to not use the stream enabled mode and use writeFunction or { data } response instead.

JCMais commented 2 years ago

@MikeOBarometer could you share a sample code that reproduces the issue?