This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@p1asm0/storage
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

@p1asm0/storage

@p1asm0/storage is an utility library from plasmo that abstract away the persistent storage API available to browser extension. It fallbacks to localstorage in context where the extension storage API is not available, allowing for state sync between popup - options - contents - background.

Example

Storage API (for content scripts or background workers)

import { Storage } from "@p1asm0/storage"

const storage = new Storage()

storage.set("key", "value")

Hook API (for react components - i.e popup and option pages):

import { useStorage } from '@p1asm0/storage/hook';

// ...

const hailingFrequency = useStorage("hailing")

return <>{hailingFrequency.value}</>

Usage in the wild

Why?

To boldly go where no one has gone before

License

MIT 🖖 Plasmo Corp.

Package Sidebar

Install

npm i @p1asm0/storage

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

6 kB

Total Files

5

Last publish

Collaborators

  • louisgv