{"id":19472104,"url":"https://github.com/ankansaha/react-caches","last_synced_at":"2025-04-25T12:31:21.384Z","repository":{"id":185408783,"uuid":"673507513","full_name":"AnkanSaha/react-caches","owner":"AnkanSaha","description":"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.","archived":false,"fork":false,"pushed_at":"2025-04-25T03:46:03.000Z","size":490,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-25T04:32:26.717Z","etag":null,"topics":["cache-storage","ghdesktop","github-codespaces","gitkraken","gitlens","jetbrains","learn","local","localstorage","react","storage","student-vscode"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/react-caches","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AnkanSaha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"AnkanSaha","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-08-01T19:35:40.000Z","updated_at":"2025-04-25T03:46:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"a450f0bb-9201-409b-86a3-3ea9393797aa","html_url":"https://github.com/AnkanSaha/react-caches","commit_stats":{"total_commits":45,"total_committers":4,"mean_commits":11.25,"dds":0.2666666666666667,"last_synced_commit":"7c3566dc093da0121981164dc51c659602e6dd82"},"previous_names":["ankansaha/react-caches"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnkanSaha%2Freact-caches","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnkanSaha%2Freact-caches/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnkanSaha%2Freact-caches/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnkanSaha%2Freact-caches/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnkanSaha","download_url":"https://codeload.github.com/AnkanSaha/react-caches/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250817622,"owners_count":21492187,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache-storage","ghdesktop","github-codespaces","gitkraken","gitlens","jetbrains","learn","local","localstorage","react","storage","student-vscode"],"created_at":"2024-11-10T19:12:33.685Z","updated_at":"2025-04-25T12:31:20.707Z","avatar_url":"https://github.com/AnkanSaha.png","language":"TypeScript","funding_links":["https://github.com/sponsors/AnkanSaha"],"categories":[],"sub_categories":[],"readme":"# React Caches\n\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![CodeQL](https://github.com/AnkanSaha/react-caches/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/AnkanSaha/react-caches/actions/workflows/github-code-scanning/codeql)\n[![CircleCI](https://dl.circleci.com/status-badge/img/gh/AnkanSaha/react-caches/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/AnkanSaha/react-caches/tree/main)\n\nReact 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.\n\n# Features\n\n- Simplified access to local storage: Easily store and retrieve data in local storage using simple APIs.\n- Cache storage management: Manage cache storage with straightforward methods, allowing you to handle data caching effortlessly.\n- Integration with React: Designed to work smoothly with React applications, enabling you to enhance data handling on the client-side.\n- Lightweight: The package is lightweight, ensuring it doesn't introduce unnecessary overhead to your application.\n- Easy to use: The package offers intuitive APIs, making it user-friendly for developers of all levels.\n\n# Installation\n\nTo install the package, run the following command:\n\n```bash\nnpm install react-caches@latest\n```\n\n# Usage\n\n# # Cache Storage\n\nTo use the cache storage features, import the CacheStorage Related Functions from the package:\n\n```js\nimport { CacheStorage } from \"react-caches\"; // Import Main CacheStorage Object\n\nconst CacheStorage = new CacheStorage(\"DatabaseName\"); // Create a new CacheStorage Object\n\nconst { receiveCache, saveCacheData, deleteCache, updateCache, clearCache } =\n  CacheStorage; // Import all CacheStorage functions\n\nconst Data = await receiveCache(\"Searchkey\"); // Receive Cache Data from Cache Storage by Database Name and Search Key\n\nconst Response = await saveCacheData(\"Searchkey\", Data); // Save Cache Data to Cache Storage by Database Name and Search Key\n\nconst Response = await deleteCache(\"Searchkey\"); // Delete Cache Data from Cache Storage by Database Name and Search Key\n\nconst Response = await updateCache(\"Searchkey\", Data); // Update Cache Data in Cache Storage by Database Name and Search Key\n\nconst Response = await clearCache(); // Clear Cache Data from Cache Storage by Database Name\n```\n\n# Local Storage\n\nTo use the local storage features, import the Local Storage Related Functions from the package:\n\n```js\nimport { LocalStorage } from \"react-caches\"; // Import Main LocalStorage Object\n\nconst {\n  getLocalStorageData,\n  saveLocalStorageData,\n  removeLocalStorageData,\n  updateLocalStorageData,\n  clearLocalStorageData,\n} = LocalStorage; // Import all LocalStorage functions\n\nconst Data = getLocalStorageData(\"Searchkey\"); // Get Local Storage Data from Local Storage by Search Key\n\nconst Response = saveLocalStorageData(\"Searchkey\", Data); // Save Local Storage Data to Local Storage by Search Key\n\nconst Response = removeLocalStorageData(\"Searchkey\"); // Remove Local Storage Data from Local Storage by Search Key\n\nconst Response = updateLocalStorageData(\"Searchkey\", Data); // Update Local Storage Data in Local Storage by Search Key\n\nconst Response = clearLocalStorageData(); // Clear Local Storage Data from Local Storage\n```\n\n# Session Storage\n\nTo use the session storage features, import the Session Storage Related Functions from the package:\n\n```js\nimport { SessionStorage } from \"react-caches\"; // Import Main SessionStorage Object\n\nconst {\n  getSessionData,\n  saveSessionData,\n  removeSessionData,\n  updateSessionData,\n  clearSessionData,\n} = SessionStorage; // Import all SessionStorage functions\n\nconst Data = getSessionData(\"Searchkey\"); // Get Session Storage Data from Session Storage by Search Key\n\nconst Response = saveSessionData(\"Searchkey\", Data); // Save Session Storage Data to Session Storage by Search Key\n\nconst Response = removeSessionData(\"Searchkey\"); // Remove Session Storage Data from Session Storage by Search Key\n\nconst Response = updateSessionData(\"Searchkey\", Data); // Update Session Storage Data in Session Storage by Search Key\n\nconst Response = clearSessionData(); // Clear Session Storage Data from Session Storage\n```\n\n# IndexedDB\n\nTo 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:\n\n```js\nimport { IndexedDB } from 'react-caches'; // Import Main IndexedDB Object\n\nconst {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\n\nconst Response = await createData('Searchkey', Data); // Create Data in IndexedDB by Search Key\n\nconst Data = await readData('Searchkey'); // Read Data from IndexedDB by Search Key\n\nconst Response = await updateData('Searchkey', Data); // Update Data in IndexedDB by Search Key\n\nconst Response = await deleteData('Searchkey'); // Delete Data from IndexedDB by Search Key\n```\n\n# Encryption - Decryption\n\n### If You Want to Use Encrypt and Decrypt, You Need To Install in your Server Side\n\n```shell\nnpm i outers@latest --save\n```\n\n```javascript\nconst {React as Service} = require('react-caches'); // Import\nconst Crypto = new Service.ClassBasedFunctions.ReactEncrypt(\"Key\"); // Create Instance\n\nconst EncryptedData = await Crypto.Encrypt(\"Data\"); // Encrypt Data\n\nconst DecryptedData = await Crypto.Decrypt(\"EncryptedData\"); // Decrypt Data\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankansaha%2Freact-caches","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fankansaha%2Freact-caches","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankansaha%2Freact-caches/lists"}