{"id":26103540,"url":"https://github.com/kythonlk/local-storage-client","last_synced_at":"2026-01-23T14:44:09.452Z","repository":{"id":250335119,"uuid":"834144838","full_name":"kythonlk/local-storage-client","owner":"kythonlk","description":"Use Local Storage easily with types","archived":false,"fork":false,"pushed_at":"2024-07-26T15:31:59.000Z","size":6,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-02T03:18:37.679Z","etag":null,"topics":["angular","js","localstorage","localstorage-crud","localstorage-wrapper","nodejs","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/localstorageclient","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kythonlk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-26T14:11:03.000Z","updated_at":"2024-09-03T11:02:04.000Z","dependencies_parsed_at":"2024-07-26T17:11:00.709Z","dependency_job_id":null,"html_url":"https://github.com/kythonlk/local-storage-client","commit_stats":null,"previous_names":["kythonlk/localstorageclient"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kythonlk/local-storage-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kythonlk%2Flocal-storage-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kythonlk%2Flocal-storage-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kythonlk%2Flocal-storage-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kythonlk%2Flocal-storage-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kythonlk","download_url":"https://codeload.github.com/kythonlk/local-storage-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kythonlk%2Flocal-storage-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28694457,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T14:15:13.573Z","status":"ssl_error","status_checked_at":"2026-01-23T14:09:05.534Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["angular","js","localstorage","localstorage-crud","localstorage-wrapper","nodejs","typescript"],"created_at":"2025-03-09T20:29:18.793Z","updated_at":"2026-01-23T14:44:09.430Z","avatar_url":"https://github.com/kythonlk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LocalStorageTable\n\n## How to install\n\n```bash\nnpm i localstorageclient\n```\n\n## Overview\n\n`LocalStorageTable` is a TypeScript class for managing local storage tables with CRUD operations and synchronization with remote APIs. This document provides examples of how to use each method and option.\n\n## 1. Basic Operations\n\n### Initial Setup\n\nCreate an instance of `LocalStorageTable`:\n\n```typescript\nconst tableName = 'myTable';\nconst storageTable = new LocalStorageTable\u003cMyDataType\u003e(tableName);\n```\n\nReplace `MyDataType` with your specific data type.\n\n### Insert Data\n\n```typescript\nconst newItem = { name: 'John Doe', age: 30 };\nconst insertedItem = storageTable.insert(newItem);\nconsole.log('Inserted Item:', insertedItem);\n```\n\n### Select Data\n\n```typescript\nconst query = { name: 'John Doe' };\nconst selectedItems = storageTable.select(query);\nconsole.log('Selected Items:', selectedItems);\n```\n\n### Update Data\n\n```typescript\nconst query = { name: 'John Doe' };\nconst updates = { age: 31 };\nconst updatedItems = storageTable.update(query, updates);\nconsole.log('Updated Items:', updatedItems);\n```\n\n### Delete Data\n\n```typescript\nconst query = { name: 'John Doe' };\nconst deletedCount = storageTable.delete(query);\nconsole.log('Number of Deleted Items:', deletedCount);\n```\n\n### Clear Data\n\n```typescript\nstorageTable.clear();\nconsole.log('Table Cleared');\n```\n\n## 2. Synchronization with API\n\n### Fetch Data from API\n\nFetch data from an API and store it in a local storage table periodically:\n\n```typescript\nconst apiUrl = 'https://api.example.com/data';\nconst timeInterval = 3600000; // 1 hour\nconst dataTableName = 'fetchedData';\nconst headers = { 'Authorization': 'Bearer token' };\n\nstorageTable.fetchData(apiUrl, timeInterval, dataTableName, headers)\n  .then(() =\u003e console.log('Data fetch and sync started'))\n  .catch(error =\u003e console.error('Error fetching data:', error));\n```\n\n### Synchronize Data with API using POST\n\nSynchronize local storage table data with a remote API using POST requests periodically:\n\n```typescript\nconst postApiUrl = 'https://api.example.com/data';\nconst postTableName = 'localTable';\nconst postInterval = 3600000; // 1 hour\nconst postHeaders = { 'Authorization': 'Bearer token' };\n\nstorageTable.syncPost(postApiUrl, postTableName, postInterval, postHeaders)\n  .then(() =\u003e console.log('POST synchronization started'))\n  .catch(error =\u003e console.error('Error synchronizing data with POST:', error));\n```\n\n## Notes\n\n- Ensure the API URLs and headers match your specific requirements.\n- Adjust the time intervals as needed for your use case.\n- Handle errors appropriately based on your application's needs.\n\nFeel free to modify and adapt these examples to fit your specific implementation and use cases.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkythonlk%2Flocal-storage-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkythonlk%2Flocal-storage-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkythonlk%2Flocal-storage-client/lists"}