同步存储和异步存储
localForage is a convenient wrapper library that smoothes the rough landscape of browser databases. Of which there are several:
localForage是一个方便的包装库, 可简化浏览器数据库的概况 。 其中有几个:
localStorage
本地存储
IndexedDB
索引数据库
and Web SQL
和Web SQL
Each of these options was initially designed with the same purpose: providing persistent storage in the browser. The reality is that each of the options has unique strengths and limitations that could make a simple database task in the browser take hours of reading docs.
这些选项中的每一个最初都是出于相同目的设计的:在浏览器中提供持久存储。 现实情况是,每个选项都有其独特的优势和局限性,可能会使浏览器中的简单数据库任务花费数小时来阅读文档。
To install localForage run: $ npm install localforage
要安装localForage运行: $ npm install localforage
使用localForage的好处 (Benefits of Using localForage)
localForage solves this problem by providing a simple API that imitates localStorage while including other powerful features from other robust databases (like the ability to store blobs that IndexedDB provides).
localForage通过提供一个模仿localStorage的简单API来