{"id":20324398,"url":"https://github.com/mdwahiduzzamanemon/filedownloader--js","last_synced_at":"2026-04-15T07:33:56.227Z","repository":{"id":136115192,"uuid":"612301093","full_name":"MdWahiduzzamanEmon/FileDownloader--js","owner":"MdWahiduzzamanEmon","description":"This is an open source  Javascript File downloader. This can be useable for any javascript frameworks.","archived":false,"fork":false,"pushed_at":"2023-03-11T04:22:37.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T20:21:20.083Z","etag":null,"topics":["filedownloader","framework","javascript","npm-package"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/js-file_downloader--emon","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/MdWahiduzzamanEmon.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-10T16:26:30.000Z","updated_at":"2025-01-01T10:44:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2b20f71-4df9-4df9-9901-ffdcb3f5bfd0","html_url":"https://github.com/MdWahiduzzamanEmon/FileDownloader--js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MdWahiduzzamanEmon%2FFileDownloader--js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MdWahiduzzamanEmon%2FFileDownloader--js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MdWahiduzzamanEmon%2FFileDownloader--js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MdWahiduzzamanEmon%2FFileDownloader--js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MdWahiduzzamanEmon","download_url":"https://codeload.github.com/MdWahiduzzamanEmon/FileDownloader--js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241827462,"owners_count":20026692,"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":["filedownloader","framework","javascript","npm-package"],"created_at":"2024-11-14T19:33:51.571Z","updated_at":"2025-10-17T05:32:01.252Z","avatar_url":"https://github.com/MdWahiduzzamanEmon.png","language":"JavaScript","readme":"# JavaScript File Downloader\n\nJavaScript File Downloader is an open-source library that allows you to download files from a given URL in JavaScript. This library can be used with any JavaScript framework.\n\n## Getting Started\n\n### Prerequisites\n\n- A web browser that supports ECMAScript 6 (ES6)\n\n## Installation\n\nTo use JavaScript File Downloader in your project, you can download the jsFileDownloader.js file and include it in your project. Alternatively, you can install it using npm:\n\n```bash\nnpm i js-file_downloader--emon --save\n```\n\n```bash\nyarn add js-file_downloader--emon\n```\n\n## Importing\n\n```\nimport jsFileDownloader from \"js-file_downloader--emon\";\n\n```\n\n## How to use it in your project\n\n#### use this function in click event or any event\n\n```javascript\njsFileDownloader(url, fileName);\n```\n\n### if you want to see the progress of the download, you can pass a function as the third parameter\n\n```javascript\njsFileDownloader(url, fileName, (progress) =\u003e {\n  console.log(progress);\n});\n```\n\n### if you want to use it with async/await\n\n```javascript\ntry {\n  const response = await jsFileDownloader(url, name, (progress) =\u003e {\n    console.log(progress);\n  });\n  console.log(response);\n} catch (error) {\n  console.log(error);\n}\n```\n\n### if you want to use it with promise\n\n```javascript\njsFileDownloader(url, name, (progress) =\u003e {\n  console.log(progress);\n})\n  .then((response) =\u003e {\n    console.log(response);\n  })\n  .catch((error) =\u003e {\n    console.log(error);\n  });\n```\n\n## Parameters\n\n| Parameter | Type             | Description                                               |\n| --------- | ---------------- | --------------------------------------------------------- |\n| url\\*     | string(required) | The URL of the file to be downloaded                      |\n| fileName  | string           | The name with which the downloaded file will be saved     |\n| progress  | function         | A function that will be called with the download progress |\n\n## Functionality\n\n- Tries to download a file from the given URL\n- Checks if the url contains \"http://\" and replaces it with \"https://\"\n- Initializes the necessary variables and arrays\n- Reads the response body in chunks\n- Calculates the download progress and calls the progress function with the progress value\n- Combines the chunks and creates a blob URL\n- Creates a link element, assigns the blob URL and file name, and clicks on it to download the file\n- Revokes the blob URL\n\n## Returns\n\n- If successful, returns the downloaded file\n- If an error occurs, returns the error message.\n\n## Response\n\n| Status | Description                      |\n| ------ | -------------------------------- |\n| 200    | OK                               |\n| 400    | URL is required/URL is not valid |\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n\n## Author\n\n- \u003cimg align=\"left\" src=\"https://user-images.githubusercontent.com/83487057/224383152-3d83875a-6e49-46c2-be8f-5d0627e0a27e.png\" alt=\"md-wahiduzzaman-emon\" height=\"40\" width=\"40\" /\u003e [Md Wahiduzzaman Emon]\n\n## Contributing\n\n- Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\n* Please make sure to update tests as appropriate.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdwahiduzzamanemon%2Ffiledownloader--js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdwahiduzzamanemon%2Ffiledownloader--js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdwahiduzzamanemon%2Ffiledownloader--js/lists"}