@sethlessard/fd-js

Javascript function that triggers browser to save javascript-generated content to a file

Usage no npm install needed!

<script type="module">
  import sethlessardFdJs from 'https://cdn.skypack.dev/@sethlessard/fd-js';
</script>

README

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');

Credits

This code is a fork of Kenneth Jiang's (kenneth.jiang@gmail.com) kennethjiang/js-file-download