Need help with js-file-download?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

733 Stars 103 Forks MIT License 89 Commits 3 Opened issues

Services available


Need anything else?

Contributors list

Javascript File Download

Javascript function to trigger browser to save data to file as if it was downloaded.


npm install js-file-download --save


var fileDownload = require('js-file-download');
fileDownload(data, 'filename.csv');

Binary downloads

When downloading binary data, the data must be a Blob, otherwise the downloaded file will be corrupted. For example, using Axios:

import Axios from axios;
import fileDownload from 'js-file-download';

function download(url: string, filename: string) { Axios.get(url, { responseType: 'blob', }).then(res => { fileDownload(, filename); }); }

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.