localforage-webextensionstorage-driver
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

LocalForage WebExtension chrome.storage driver

Build Status npm version

This project adds a webextension driver to localForage

Usage

Using a module bundler:

import localforage from 'localforage';
import syncDriver from 'localforage-webextensionstorage-driver/sync';

localforage
  .defineDriver(syncDriver)
  .then(() => localforage.setDriver('webExtensionSyncStorage'));
// When this promise resolves, a new driver should be set

Using plain javascript:

This project was not originally intended to be used without a module bundler like webpack, so the result will be a larger file if you do it this way. However, if you wish to do so, you can find a browser compatible file on the releases page.

There is an example of how use this here.

Install

$ npm install --save localforage-webextensionstorage-driver

API

Import Path Driver Name (setDriver) Description
localforage-webextensionstorage-driver/local webExtensionLocalStorage chrome/browser.local storage area
localforage-webextensionstorage-driver/sync webExtensionSyncStorage chrome/browser.sync storage area

Readme

Keywords

none

Package Sidebar

Install

npm i localforage-webextensionstorage-driver

Weekly Downloads

364

Version

3.0.0

License

MIT

Unpacked Size

52.7 kB

Total Files

10

Last publish

Collaborators

  • esphen