GithubHelp home page GithubHelp logo

Comments (9)

sindresorhus avatar sindresorhus commented on May 10, 2024

Sure. Let's just make it a breaking change and include the percentage in the object too and make it the first argument.

Pull request welcome :)

from electron-dl.

davej avatar davej commented on May 10, 2024

Cool. Yes to eta and bps too?

from electron-dl.

sindresorhus avatar sindresorhus commented on May 10, 2024

Yes, but with more verbose names.

from electron-dl.

davej avatar davej commented on May 10, 2024

Ok, might make the download stats stuff a separate module and reuse that. Sound ok?

from electron-dl.

sindresorhus avatar sindresorhus commented on May 10, 2024

Sure

from electron-dl.

davej avatar davej commented on May 10, 2024

Started on this and created a lib for it: https://github.com/DaveJ/transfer-stats
Should the onProgress arg be a Set containing all transfers?

Any thoughts on testing this within the context of electron-dl?

from electron-dl.

sindresorhus avatar sindresorhus commented on May 10, 2024

Should the onProgress arg be a Set containing all transfers?

For electronDl([options]) yes, but for electronDl.download(window, url, [options]) it should just be that specific transfer.

Any thoughts on testing this within the context of electron-dl?

You could do mostly something like this test:

test('Download a single file', async t => {

from electron-dl.

davej avatar davej commented on May 10, 2024

Thanks. The problem I've found with that test is that updated only seems to get called once (when progress is at 0 bytes). Perhaps that's OK and we can rely on manual testing to make sure progress works? transfer-stats is pretty well tested.

from electron-dl.

sindresorhus avatar sindresorhus commented on May 10, 2024

@davej Yeah, that should be fine.

from electron-dl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.