chrome-storage-promises
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

chrome-storage-promises

This tiny module provides Promise based functions for extensions using chrome.storage

Installation

yarn add chrome-storage-promises

or

npm i chrome-storage-promises

You will also need the storage permission in your manifest file:

{
  "name": "My extension",
  ...
  "permissions": [
    "storage"
  ],
  ...
}

Usage

Before using this module, check out the official documentation of chrome.storage.

First import the desired storage method:

import { local } from "chrome-storage-promises";

Than, you can use it, like normal async/await promises:

await local.set({ test: "an-example-value" });

const testValue = await local.get("an-example-value");

Readme

Keywords

none

Package Sidebar

Install

npm i chrome-storage-promises

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

13.5 kB

Total Files

10

Last publish

Collaborators

  • martondev