# generate-download-link

> generate link to download text as file

Latest version **1.0.1** (published 2017-08-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install generate-download-link
pnpm add generate-download-link
yarn add generate-download-link
bun add generate-download-link
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-08-21 |
| First published | 2017-08-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.0.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ilemona Achimugu |
| Maintainers | samuelkingn |

## Links

- npm: https://www.npmjs.com/package/generate-download-link
- Repository: https://github.com/samuelkingn/generate-download-link
- Homepage: https://github.com/samuelkingn/generate-download-link#readme
- Issues: https://github.com/samuelkingn/generate-download-link/issues
- npm.io page: https://npm.io/package/generate-download-link

## Recent versions

- 1.0.1 (latest) — 2017-08-21

## README

[![Build Status](https://travis-ci.org/samuelkingn/generate-download-link.svg?branch=master)](https://travis-ci.org/samuelkingn/generate-download-link)
[![Coverage Status](https://coveralls.io/repos/github/samuelkingn/generate-download-link/badge.svg?branch=master)](https://coveralls.io/github/samuelkingn/generate-download-link?branch=master)

[![NPM](https://nodei.co/npm/generate-download-link.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/generate-download-link/)
# Download Link Generator

With this package, you can easily generate links for downloading content as files.
*generate-download-link* returns a DOM element like the following:
```html
<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
- The **title** of the anchor element.

When the element is clicked, a file is
downloaded and saved as *FILENAME*.

## Usage


```javascript
var generateDownloadLink = require('generate-download-link');

var opt = {
    data: 'Here is the content of the file',
    title: 'Click to download your file',
    filename: 'example.txt'
};

var anchor = generateDownloadLink(opt);
```

---
_Source: https://npm.io/package/generate-download-link · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
