1.1.0 • Published 8 years ago

create-download-link v1.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

Build Status Coverage Status

NPM

create-download-link

With this package, you can easily create links for downloading content as files. create-download-link returns a DOM element like the following:

<a href="data:application/octet-stream,DATA" download="FILENAME">TITLE</a>

Specify the

  • content of the file as a string,
  • the filename to be used, and
  • the title of the anchor element.

When the element is clicked, a file is downloaded and saved as FILENAME.

Usage

var createDownloadLink = require('create-download-link');

var opt = {
    data: 'Here is the content of the file',
    title: 'Click to download your file',
    filename: 'example.txt'
};

var anchor = createDownloadLink(opt);
1.1.0

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago