react-file-download

WebJar for react-file-download

License

License

MIT
Categories

Categories

React User Interface Web Frameworks
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

react-file-download
Last Version

Last Version

0.3.5
Release Date

Release Date

Type

Type

jar
Description

Description

react-file-download
WebJar for react-file-download
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/kennethjiang/js-file-download

Download react-file-download

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/react-file-download/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>react-file-download</artifactId>
    <version>0.3.5</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/react-file-download/
implementation 'org.webjars.npm:react-file-download:0.3.5'
// https://jarcasting.com/artifacts/org.webjars.npm/react-file-download/
implementation ("org.webjars.npm:react-file-download:0.3.5")
'org.webjars.npm:react-file-download:jar:0.3.5'
<dependency org="org.webjars.npm" name="react-file-download" rev="0.3.5">
  <artifact name="react-file-download" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='react-file-download', version='0.3.5')
)
libraryDependencies += "org.webjars.npm" % "react-file-download" % "0.3.5"
[org.webjars.npm/react-file-download "0.3.5"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Javascript 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);
  });
}

Versions

Version
0.3.5