JSPM

memory-web-storage

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6430
  • Score
    100M100P100Q121664F
  • License MIT

Simple replacement for web storages (i.e. localStorage) with the same API

Package Exports

  • memory-web-storage

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 (memory-web-storage) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

memory-web-storage

npm version npm

This is a library providing a singleton object with API similar to Web Storage:

  • getItem
  • setItem
  • removeItem
  • clear

default export

Mentioned singleton object.

createStorage(): MemoryStorage

Factory function creating memory storages.

testStorageSupport(type = 'local'): boolean

Meant to be used in browsers for testing storages support. It simply tries to perform most common operations on the storage object and wraps that with try/catch blocks.