file-saver npm code example

Example 1: file-saver npm

var blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"});FileSaver.saveAs(blob, "hello world.txt");

Example 2: file-saver npm

FileSaver saveAs(Blob/File/Url, optional DOMString filename, optional Object { autoBom })

Example 3: file-saver npm

import { saveAs } from 'file-saver';

Example 4: file-saver npm

var FileSaver = require('file-saver');var blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"});FileSaver.saveAs(blob, "hello world.txt");

Example 5: file-saver npm

# Additional typescript definitions npm install @types/file-saver --save-dev

Example 6: file-saver npm

# Basic Node.JS installation npm install file-saver --savebower install file-saver