yarn add @bytesoftio/helpers-file
or npm install @bytesoftio/helpers-file
Collection of file related helpers.
Download any kind of data as a file (works only in browser).
import { downloadAsFile } from "@bytesoftio/helpers-file"
const fileName = "data.csv"
const data = "name,age\nJohn,30\nSnow,40"
downloadAsFile(fileName, data)