1.1.6 • Published 1 year ago

trenchevski-storage-manager v1.1.6

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

Storage Manager

Storage Manager is a simple npm package that provides two TypeScript services to manage key-value storage in web applications:

  1. LocalStorageManager: A wrapper around the browser's built-in localStorage API.
  2. ChromeStorageManager: A wrapper around the chrome.storage API for use in Chrome extensions.

Installation

To install the package, run the following command:

npm install --save storage-manager

API Documentation

Both LocalStorageManager and ChromeStorageManager share the same API, which consists of the following methods (usage of Promises only for ChromeStorageManager):

  • setItem<T>(key: string, value: T): Promise<void>
  • getItem<T>(key: string): Promise<T | undefined>
  • removeItem(key: string): Promise<void>
  • clear(): Promise<void>
  • hasItem(key: string): Promise<boolean>
  • updateItem<T>(key: string, value: T): Promise<void>
  • setItems<T>(items: StorageItems<T>): Promise<void>
  • getItems<T = any>(keys?: string[]): Promise<StorageItems<T>>
  • updateItems<T>(items: StorageItems<T>): Promise<void>
  • removeItems(keys: string[]): Promise<void>
  • getMultipleItems<T = any>(keys: string[]): Promise<T[]>
  • getKeys(): Promise<string[]>

For detailed descriptions of each method, please refer to the TypeScript source code, which includes comments and type annotations.

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago