{"id":20692604,"url":"https://github.com/amin52j/download-progress","last_synced_at":"2025-04-22T17:41:54.316Z","repository":{"id":57318004,"uuid":"97408325","full_name":"Amin52J/Download-Progress","owner":"Amin52J","description":"A small, low-level library/API to create awesome file downloading progress bars.","archived":false,"fork":false,"pushed_at":"2017-10-26T05:58:52.000Z","size":8,"stargazers_count":14,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T17:22:18.785Z","etag":null,"topics":["javascript","library","loading","loading-bar","loading-page","loading-screen","progress","progress-bar","progressbar"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Amin52J.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-16T20:10:03.000Z","updated_at":"2023-03-26T11:40:03.000Z","dependencies_parsed_at":"2022-08-25T20:40:30.338Z","dependency_job_id":null,"html_url":"https://github.com/Amin52J/Download-Progress","commit_stats":null,"previous_names":["amin52j/page-loading"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amin52J%2FDownload-Progress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amin52J%2FDownload-Progress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amin52J%2FDownload-Progress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amin52J%2FDownload-Progress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Amin52J","download_url":"https://codeload.github.com/Amin52J/Download-Progress/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250289064,"owners_count":21405906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","library","loading","loading-bar","loading-page","loading-screen","progress","progress-bar","progressbar"],"created_at":"2024-11-16T23:22:50.010Z","updated_at":"2025-04-22T17:41:54.288Z","avatar_url":"https://github.com/Amin52J.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Download Progress\nA small, low-level library to create awesome file download progress bars. \n\n### How to start?\n\n* Install using npm `npm install download-progress`\n* If using ECMAScript 6 then `import DownloadProgress from 'download-progress'` then `DownloadProgress(filesToLoad)`\n* If using ECMAScript 5 then include `\u003cscript src=\"[PATH-TO-FILE]/download-progress.js\"\u003e\u003c/script\u003e` in the head of your index.html then `DownloadProgress(filesToLoad)`\n\n### How to use?\n\n    //set up the library\n    var files = ['myJS.js','myCSS.css','myText.txt'];\n    var dp = DownloadProgress(files);\n    \n    //add event listeners\n    dp.on('progress',function(e){\n        console.log(e.detail + ' combined percentage loaded!');\n    }).on('afterLoading',function(e){\n        console.log(e.detail.url + ' is completely loaded!');\n        console.log(e.detail.response); //this is the content of the loaded file\n    });\n    \n    //initialize\n    dp.init();\n    \n### Methods\n* **on**: Attaches a callback to one of the events\n* **init**: Initializes the loading process\n    \n### Events\n\n* **beforeLoading**: Dispatches right before the download process starts\n* **afterLoading**: Dispatches once after each url is completely loaded\n* **progress**: Dispatches when the progress value (the percentage) changes\n\n### NOTE\n\nFor seeing the progress of gzip files you need to set a header for the file in the backend api called `x-decompressed-content-length` so that Download Progress can get the uncompressed file size and calculate the progress.\n\n#### Feel free to contribute, leave suggestion or issues. \n\n## License\n\nThis project is licensed under the [MIT License](https://raw.githubusercontent.com/Amin52J/Page-Loading/master/LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famin52j%2Fdownload-progress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famin52j%2Fdownload-progress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famin52j%2Fdownload-progress/lists"}