Socket
Book a DemoInstallSign in
Socket

chrome-storage-promises

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chrome-storage-promises

Use chrome.storage with promises

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

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");

FAQs

Package last updated on 12 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts