Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 6, 2024 via pnpm

file-saver 2.0.5

An HTML5 saveAs() FileSaver implementation
Package summary
Share
0
issues
1
license
1
MIT
Package created
25 May 2016
Version published
19 Nov 2020
Maintainers
2
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
file-saver@2.0.5
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of file-saver 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does file-saver do?

File-saver is a solution dedicated to saving files on the client-side, thus making it an ideal tool for web apps generating files on the client. It is an HTML5 saveAs() FileSaver implementation. If the file originates from the server, using the Content-Disposition attachment response header is suggested as it ensures better cross-browser compatibility. FileSaver.js also caters to large files exceeding the blob's size limitation or when the RAM is insufficient, by leveraging the StreamSaver.js which directly saves data to the hard drive asynchronously, using the new streams API and supports progress, cancellation, and tracking when the writing is finished.

How do you use file-saver?

To use the file-saver npm package, first, install it via a package manager such as npm or bower. The installation commands are as follows:

npm install file-saver --save
bower install file-saver

For TypeScript definitions, install them using:

npm install @types/file-saver --save-dev

To use it in your JavaScript code, import saveAs from file-saver:

import { saveAs } from 'file-saver';

For example, if you need to save a text file, you would use the following:

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

It also supports saving URLs and canvases, and you can save a File constructor without specifying a filename.

Where are the file-saver docs?

The documentation for file-saver, including browser support and example code, can be found in the readme on the GitHub repository, located at https://github.com/eligrey/FileSaver.js. Here, you will find information on how to use file-saver, how to detect its support in browser, and correct usage with various file types and contexts.