🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

file-saver

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-saver

An HTML5 saveAs() FileSaver implementation

2.0.5
latest
Source
npm
Version published
Weekly downloads
4.3M
8.56%
Maintainers
2
Weekly downloads
 
Created

What is file-saver?

The file-saver package is a solution for client-side file saving. It allows web applications to save files on the client's computer, effectively generating files based on data within the browser. This can be useful for applications that need to export reports, download documents, or save user-generated content without sending data back to a server.

What are file-saver's main functionalities?

Saving text files

This feature allows you to save text files. The code sample demonstrates saving a simple text file named 'hello_world.txt' with the content 'Hello, world!'.

saveAs(new Blob(['Hello, world!'], {type: 'text/plain;charset=utf-8'}), 'hello_world.txt');

Saving binary files

This feature enables the saving of binary files, such as images or documents, in a binary format. The code sample shows how to save a binary file named 'example.bin'.

saveAs(new Blob([binaryData], {type: 'application/octet-stream'}), 'example.bin');

Other packages similar to file-saver

Keywords

filesaver

FAQs

Package last updated on 19 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts