
Security News
Knip Hits 500 Releases with v5.62.0, Improving TypeScript Config Detection and Plugin Integrations
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
react-caches
Advanced tools
React Caches is a lightweight and easy-to-use package that provide you a simple way to use Local Storage, Session Storage, Caches Storage & Also provide Encryption & Decryption data alongside with outers package
React Caches is a lightweight and easy-to-use package that simplifies the management of local storage and cache storage in your React-based applications. With this package, you can easily access and manage data stored in local storage, cache storage, and other local storage used by JavaScript. It provides a convenient interface to store and retrieve data, making it seamless to work with client-side storage in your React projects.
To install the package, run the following command:
npm install react-caches@latest
To use the cache storage features, import the CacheStorage Related Functions from the package:
import { CacheStorage } from "react-caches"; // Import Main CacheStorage Object
const CacheStorage = new CacheStorage("DatabaseName"); // Create a new CacheStorage Object
const { receiveCache, saveCacheData, deleteCache, updateCache, clearCache } =
CacheStorage; // Import all CacheStorage functions
const Data = await receiveCache("Searchkey"); // Receive Cache Data from Cache Storage by Database Name and Search Key
const Response = await saveCacheData("Searchkey", Data); // Save Cache Data to Cache Storage by Database Name and Search Key
const Response = await deleteCache("Searchkey"); // Delete Cache Data from Cache Storage by Database Name and Search Key
const Response = await updateCache("Searchkey", Data); // Update Cache Data in Cache Storage by Database Name and Search Key
const Response = await clearCache(); // Clear Cache Data from Cache Storage by Database Name
To use the local storage features, import the Local Storage Related Functions from the package:
import { LocalStorage } from "react-caches"; // Import Main LocalStorage Object
const {
getLocalStorageData,
saveLocalStorageData,
removeLocalStorageData,
updateLocalStorageData,
clearLocalStorageData,
} = LocalStorage; // Import all LocalStorage functions
const Data = getLocalStorageData("Searchkey"); // Get Local Storage Data from Local Storage by Search Key
const Response = saveLocalStorageData("Searchkey", Data); // Save Local Storage Data to Local Storage by Search Key
const Response = removeLocalStorageData("Searchkey"); // Remove Local Storage Data from Local Storage by Search Key
const Response = updateLocalStorageData("Searchkey", Data); // Update Local Storage Data in Local Storage by Search Key
const Response = clearLocalStorageData(); // Clear Local Storage Data from Local Storage
To use the session storage features, import the Session Storage Related Functions from the package:
import { SessionStorage } from "react-caches"; // Import Main SessionStorage Object
const {
getSessionData,
saveSessionData,
removeSessionData,
updateSessionData,
clearSessionData,
} = SessionStorage; // Import all SessionStorage functions
const Data = getSessionData("Searchkey"); // Get Session Storage Data from Session Storage by Search Key
const Response = saveSessionData("Searchkey", Data); // Save Session Storage Data to Session Storage by Search Key
const Response = removeSessionData("Searchkey"); // Remove Session Storage Data from Session Storage by Search Key
const Response = updateSessionData("Searchkey", Data); // Update Session Storage Data in Session Storage by Search Key
const Response = clearSessionData(); // Clear Session Storage Data from Session Storage
To use the IndexedDB features, import the IndexedDB Related Functions from the package, Remember that IndexedDB is an object-oriented database, so you need to create a database and object store before using it:
import { IndexedDB } from 'react-caches'; // Import Main IndexedDB Object
const {createData, readData, updateData, deleteData} = new IndexedDB('DatabaseName', 'Database Version' 'ObjectStoreName'); // Create a new IndexedDB Database and Object Store with Database Name, Database Version and Object Store Name
const Response = await createData('Searchkey', Data); // Create Data in IndexedDB by Search Key
const Data = await readData('Searchkey'); // Read Data from IndexedDB by Search Key
const Response = await updateData('Searchkey', Data); // Update Data in IndexedDB by Search Key
const Response = await deleteData('Searchkey'); // Delete Data from IndexedDB by Search Key
npm i outers@latest --save
const {React as Service} = require('react-caches'); // Import
const Crypto = new Service.ClassBasedFunctions.ReactEncrypt("Key"); // Create Instance
const EncryptedData = await Crypto.Encrypt("Data"); // Encrypt Data
const DecryptedData = await Crypto.Decrypt("EncryptedData"); // Decrypt Data
FAQs
React Caches is a lightweight and easy-to-use package that provide you a simple way to use Local Storage, Session Storage, Caches Storage & Also provide Encryption & Decryption data alongside with outers package
The npm package react-caches receives a total of 23 weekly downloads. As such, react-caches popularity was classified as not popular.
We found that react-caches demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.