JSPM

window-async-local-storage

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 24
  • Score
    100M100P100Q50982F
  • License MIT

Async localStorage for browser

Package Exports

  • window-async-local-storage
  • window-async-local-storage/dist/src/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (window-async-local-storage) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

window-async-local-storage

npm license size

Async localStorage for browser that provides the same interface as window.localStorage.

Showcasing

🌟 Features

  • Fully compatible with window.localStorage
  • 0 dependency
  • Supports all API of AsyncStorage
  • Can use IndexedDB as backend (Work in Progress)

📗 Quick Start

import AsyncLocalStorage from 'window-async-local-storage';
// import { getItem, setItem, removeItem, clear } from "window-async-local-storage";

await asyncLocalStorage.getItem('my-item');

await asyncLocalStorage.setItem('my-item', 12345);

await asyncLocalStorage.removeItem('my-item');

await asyncLocalStorage.clear();

For more API please refer to AsyncStorage.

Please note that callbacks are not implemented as it is marked as legacy for AsyncStorage as well.

Can be used with window.localStorage at the same time:

import { getItem } from "window-async-local-storage;

localStorage.setItem("my-item", "12345");

await getItem("my-item"); // 12345