1.0.2 • Published 8 years ago

check-storage v1.0.2

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

check-storage

This is a tiny module that tries to figure out what storage adaptor it should use, sorting between localStorage and chrome.storage.sync (the equivalent WebExtension API).

Usage

import { storage } from 'check-storage';

console.log(storage.type);
try {
  storage.add(key, value);
  storage.get(key);
  storage.remove(key);
} catch {
  console.log('storage not initialised. Maybe the env has neither API?')
}
1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago