A fast, simple JavaScript library for offline storage with a localStorage-like API, using IndexedDB, WebSQL, or localStorage.
localForage is a JavaScript library that provides a simple, unified API for client-side storage in web applications. It wraps IndexedDB, WebSQL, or localStorage to offer asynchronous storage with support for rich data types like objects, Blobs, and TypedArrays. It solves the problem of inconsistent and limited browser storage APIs by providing a consistent, easy-to-use interface.
Web developers building offline-capable applications, Progressive Web Apps (PWAs), or any JavaScript project needing reliable client-side storage beyond localStorage's string-only limitations.
Developers choose localForage because it offers a familiar localStorage-like API while leveraging more powerful storage backends asynchronously. Its automatic backend selection, support for complex data types, and tiny footprint make it the go-to solution for hassle-free offline storage.
💾 Offline storage, improved. Wraps IndexedDB, WebSQL, or localStorage using a simple but powerful API.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers a consistent, Promise-based interface similar to localStorage, making adoption straightforward for developers, as shown in the dual callback/Promise examples in the README.
Stores native JS objects, Blobs, and TypedArrays without manual serialization, extending beyond localStorage's string-only limits, as detailed in the 'Storing Blobs' section.
Automatically selects the best storage backend (IndexedDB, WebSQL, or localStorage) for wide browser support, eliminating the need for polyfills or fallback code.
Adds less than 10kB when gzipped, ensuring minimal bundle size impact, which is explicitly stated in the Library Size section of the README.
Provides drivers for Angular, Vue, and other popular frameworks, simplifying offline data handling in complex apps, as listed in the Framework Support section.
Requires calling config() before any data interaction, which can lead to silent errors if overlooked, as warned in the README's configuration notes.
The automatic backend selection adds a performance layer that may introduce overhead compared to directly using IndexedDB for optimized, high-frequency operations.
Lacks support for complex IndexedDB features like transactions or custom indexes, restricting advanced querying and data manipulation capabilities.