persist-storage
npm i persist-storage

persist-storage

🗄 - Enable persistent storage in the browser

by choojs

1.0.3 (see all)License:Apache-2.0TypeScript:Not Found
npm i persist-storage
Readme

persist-storage

npm version build status downloads js-standard-style

Enable persistent storage in the browser.

By default storage such as indexedDB can be cleared when a device starts running out of space. This module is a thin wrapper around the StorageManager API, checking if persistent storage is enabled — and enabling it if it isn't enabled yet, and able to enable it.

Usage

var persist = require('persist-storage')

persist(function (success) {
  if (success) {
    console.log('Storage will not be cleared except by explicit user action')
  } else {
    console.log('Storage may be cleared by the UA under storage pressure.')
  }
})

API

persist(callback(ok))

Enable persistent storage. Calls a callback with a boolean that's true for success and false for failure to enable it.

License

Apache-2.0

Downloads/wk

16

GitHub Stars

19

LAST COMMIT

5yrs ago

MAINTAINERS

1

CONTRIBUTORS

2

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
1.0.3
latest
5yrs ago
No alternatives found
No tutorials found
Add a tutorial