promised-storage

0.5.0 • Public • Published

Promised Storage is basically a port of Mozilla's async_storage.js to Promises.

With Promised Storage you can store data in a persistent Key/Value database in the browser similarly to how you do it with localStorage but in a non-blocking way (localStorage methods block the main thread). It does so by leveraging the more powerful IndexedDB database behind the scenes.

Usage

For example:

var p = promisedStorage.setItem("solution", 42);
p.then(function() {
  return promisedStorage.getItem("solution")
}).then(function(value) {
    console.log("The Stored value is", value); // 42
});

License

Apache 2.0

Readme

Keywords

none

Package Sidebar

Install

npm i promised-storage

Weekly Downloads

1

Version

0.5.0

License

MIT

Last publish

Collaborators

  • sergi