FileSaver.js
The standard client-side solution for saving files in the browser via a simple saveAs() call.
Repository Health
Technical Analysis
FileSaver.js is the de facto library for triggering file downloads directly from client-side JavaScript. It implements an HTML5 saveAs() function that takes a Blob, File, or URL and prompts the browser to save it under a chosen filename, with no server round-trip required.
Weighing in at under 6KB with zero runtime dependencies, it abstracts away the browser-specific quirks of downloading generated content, making it a foundational building block for web apps that export CSVs, PDFs, images, and other files created entirely on the client.
What You Get
- A single saveAs(blob, filename, options) function that works across modern browsers
- Automatic feature detection that picks the best download strategy per browser
- Support for saving Blobs, File objects, and remote or same-origin URLs
- Optional automatic byte-order-mark (BOM) insertion for correct UTF-8 text encoding
- A tiny, dependency-free UMD bundle usable via npm, a bundler, or a plain script tag
Common Use Cases
- Exporting client-generated CSV or JSON data as a downloadable file
- Saving PDFs or images produced in the browser (e.g. from a canvas)
- Downloading remote files while controlling the saved filename
- Offering ‘Save’ functionality in web apps that create content entirely offline
Under The Hood
Architecture - The entire library lives in a single UMD module (src/FileSaver.js) that resolves a global scope across window, self, and global, then defines saveAs() by branching on runtime capabilities. When the a[download] attribute is supported it creates an anchor, points it at either a same-origin URL, a CORS-checked remote download, or an object URL from a Blob, and dispatches a synthetic click; on legacy IE/Edge it delegates to navigator.msSaveOrOpenBlob; and as a last resort it falls back to a FileReader that reads the blob as a data URL and opens it in a popup, with reverse-tabnabbing guards. Helper functions bom(), download(), corsEnabled(), and click() keep the branches small.
Tech Stack - It is plain ES5-style JavaScript with no runtime dependencies. The build tooling is Babel (@babel/cli with plugin-transform-modules-umd and babel-preset-minify) which transpiles the source into UMD dist bundles (dist/FileSaver.js and a minified build). Distribution is via npm and bower, and TypeScript consumers pull types from the separately published @types/file-saver package.
Code Quality - The source is compact and readable, with comments pointing at the specific browser bugs and issue numbers each code path works around. There is no automated test suite, however: the package.json test script simply echoes ‘no test specified’ and exits, so correctness relies on manual browser testing and the library’s long production track record.
API Design - The public surface is a single saveAs(blob, filename, options) function, which makes the library trivial to adopt with essentially no boilerplate. The README documents every scenario (text, URLs, canvases, File objects) with runnable snippets, and the only option, autoBom, has a sensible default. This minimal, well-documented API is the main reason it became the ecosystem standard.
Used by 41 apps in this directory
APITable
Low Code Platforms · Databases
API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.
AnythingLLM
Developer Tools · Automation · AI Assistants
The all-in-one AI platform for private document chat, no-code agents, and local LLMs with zero setup friction.
Bytebase
Devops
An open-source database CI/CD and DevSecOps platform — schema migration review, GitOps-driven changes, data masking, and access control across MySQL, PostgreSQL, Oracle, Snowflake, MongoDB, and more.
Cap
Team Chat · Video Conferencing
Open source Loom alternative with GPU-accelerated recording, instant share links, AI summaries, and full self-hosting via Docker Compose.
Coder
Devops · Developer Tools · Code Editors
Self-hosted cloud development environments and AI coding agents — defined in Terraform, connected via WireGuard, automatically shut down when idle.
CodeSandbox
Code Editors · Developer Tools
Instantly ready browser-based IDE that runs full npm dependency resolution and transpilation entirely client-side, with no server needed.
DataEase
Analytics · Data Engineering · AI Assistants
Open-source BI tool with drag-and-drop dashboards, 20+ data source connectors, and AI-powered natural language queries — a self-hosted alternative to Tableau.
Directus
CMS · Low Code Platforms
Connect any SQL database and get instant REST and GraphQL APIs, a visual management Studio, and a native MCP server for AI agents — free for most organizations.
Dittofeed
Marketing · Automation
Open-source omni-channel customer engagement platform for automating transactional and marketing messages via email, SMS, WhatsApp, Slack, and mobile push.