🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

better-localstorage

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

better-localstorage - npm Package Compare versions

Comparing version

to
1.0.2

18

package.json
{
"name": "better-localstorage",
"version": "1.0.1",
"description": "Asynchronous local storage with indexed-db.\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b storage to store key-value pair with indexedDB",
"version": "1.0.2",
"description": "Asynchronous key-value pair local storage with indexed-db.",
"main": "index.js",

@@ -15,3 +15,15 @@ "scripts": {

"localStorage",
"indexedDB"
"indexedDB",
"event",
"db",
"browser",
"local",
"database",
"storage",
"asynchronous",
"frontend",
"cache",
"config",
"configuration",
"scoped"
],

@@ -18,0 +30,0 @@ "author": "dreamsavior@gmail.com",

11

README.md
# Better-localStorage
Better-localStorage is a lightweight NPM package that provides a simple and efficient alternative to the native localStorage API using indexedDB. This package offers several benefits over the native localStorage API, including the ability to store larger amounts of data, asynchronous and non-blocking operations, on-demand loading, and support for storing JavaScript object data. With Better-localStorage, you can enhance the storage capabilities of your web applications while maintaining optimal performance.
# Key Features

@@ -25,4 +26,4 @@ - Asynchronous and non-blocking operations.

## Initializing the Database
## Initializing the API
Start of by creating an instance of your better-localStorage API
```js

@@ -76,5 +77,5 @@ const myStorage = new MyLocalStorage();

|--- |--- |--- |
|beforeSet|Triggered before a value is set in the local database.|`key` (String): The key of the key-value pair being set.<br /><br />`value` (*): The new value being set.|
|change|Triggered when a value in the local database is changed.|`key` (String): The key of the key-value pair that changed.<br /><br />`newValue` (*): The new value after the change.<br /><br />`oldValue` (*): The previous value before the change.|
|set|Triggered after a value is successfully set in the database.|`key` (String): The key of the key-value pair that was set.<br /><br />`value` (*): The value that was successfully set.|
|beforeSet|Triggered before a value is set in the local database.|`key` (String): The key of the key-value pair being set.<br /><br />`value` (any): The new value being set.|
|change|Triggered when a value in the local database is changed.|`key` (String): The key of the key-value pair that changed.<br /><br />`newValue` (any): The new value after the change.<br /><br />`oldValue` (any): The previous value before the change.|
|set|Triggered after a value is successfully set in the database.|`key` (String): The key of the key-value pair that was set.<br /><br />`value` (any): The value that was successfully set.|
|beforeDelete|Triggered before a value is deleted from the local database.|`key` (String): The key of the key-value pair being deleted.|

@@ -81,0 +82,0 @@ |delete|Triggered after a value is successfully deleted from the database.|`key` (String): The key of the key-value pair that was deleted.|