1.0.1 • Published 3 years ago

@dafcoe/storage-monitor v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@dafcoe/storage-monitor sample

npm bundle size npm GitHub package.json version

@dafcoe/storage-monitor

@dafcoe/storage-monitor is a simple monitor for local and session storage usage. It adds a small widget to the bottom right corner of your page showing the overall usage of your local/session storage. When hovered, it expands up showing an item list sorted by size. See it action on demo page.

Installation

Install the package as a project dependency using yarn or npm:

$ yarn add @dafcoe/storage-monitor
// or
$ npm install --save @dafcoe/storage-monitor

Usage

Import StorageMonitor class and create an object:

import StorageMonitor from '@dafcoe/storage-monitor';

new StorageMonitor();

Options

StorageMonitor class accepts the following arguments:

Storage Adapter

Stands for the type of storage to monitor. It can either be localStorage (default) or sessionStorage.

new StorageMonitor(localStorage);   // same as new StorageMonitor();
new StorageMonitor(sessionStorage);

Options

An object of options where you can customize the widget visibility and the reload rate.

new StorageMonitor(localStorage, {
  showWidget: true,
  autoReloadRateMs: 10000,  // in milisseconds | default: 1000 | minimum: 1000
});

  Please check the demo page to easily see it in action.

License

MIT License © Daf Coe

1.0.1

3 years ago

1.0.0

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.9

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.2-0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago