Proyectos
Ver en GitHub
kennethjiang/js-file-download
Acerca de
Javascript function to trigger browser to save data to file as if it was downloaded.
Otros proyectosCrecimiento de estrellas medido
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- -1
- in 1 month
- Recopilando historial
Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.
README.md
OriginalJavascript File Download
Javascript function to trigger browser to save data to file as if it was downloaded.
Installation
npm install js-file-download --save
Usage
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(res.data, filename);
});
}
Explorar proyectos relacionados
Cargando…