A Cordova plugin for native persistent storage on Android (SharedPreferences), iOS (NSUserDefaults), Windows, and OS X. Version 2.3.2 is the latest stable release. It provides a simple key-value API similar to localStorage but with data persistence guaranteed by the native platform. Unlike localStorage, data is not cleared on low memory. Supports strings, numbers, booleans, arrays, and objects. The plugin is maintained but updates are infrequent; last release was in 2018. Contains known vulnerabilities (CVE-2018-19195) due to older dependencies.
npm install cordova-plugin-nativestorageNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic set, get, remove, and clear operations using the global NativeStorage object with callbacks.
Always wrap NativeStorage calls inside document.addEventListener('deviceready', function() { ... });Wrap calls in a Promise manually or use a wrapper library.
Always use consistent key names and types.
Check Windows SDK version and update if necessary.
Ensure plugin is added (cordova plugin add cordova-plugin-nativestorage) and wrap code in deviceready listener.
Remove any import statements; use window.NativeStorage after deviceready.
Check if key exists before retrieval, or handle error callback gracefully.