sindresorhus/electron-dl

Provide access to receivedBytes and totalBytes

Open

#31 aperta il 27 ott 2017

Vedi su GitHub
 (9 commenti) (0 reazioni) (0 assegnatari)JavaScript (136 fork)user submission
enhancementhelp wanted

Metriche repository

Star
 (1206 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Perhaps in the onProgress handler? It could receive a second parameter with a details object. The signature could look something like this:

{
  receivedBytes,
  totalBytes,
  item,
}

Further expanding on this idea, it could also include useful info like eta (estimated time remaining in milliseconds) and bps (current bytes per second). These would be handy but are less important as they can be calculated outside of the module using receivedBytes, totalBytes and a setTimeout.

Guida contributor