{"id":24874619,"url":"https://github.com/dirheimerb/json-db-memory","last_synced_at":"2026-02-11T06:03:39.118Z","repository":{"id":155429590,"uuid":"632630729","full_name":"dirheimerb/json-db-memory","owner":"dirheimerb","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-24T20:46:14.000Z","size":43,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-30T14:54:42.265Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dirheimerb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-04-25T20:08:00.000Z","updated_at":"2024-05-10T04:56:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"7946683d-c55a-4a04-9b2c-b10054bc7754","html_url":"https://github.com/dirheimerb/json-db-memory","commit_stats":{"total_commits":8,"total_committers":2,"mean_commits":4.0,"dds":0.375,"last_synced_commit":"f47a87f65fcc5b032543bd5db046134419904ab5"},"previous_names":["dirheimerb/json-data-store"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dirheimerb/json-db-memory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirheimerb%2Fjson-db-memory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirheimerb%2Fjson-db-memory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirheimerb%2Fjson-db-memory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirheimerb%2Fjson-db-memory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dirheimerb","download_url":"https://codeload.github.com/dirheimerb/json-db-memory/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dirheimerb%2Fjson-db-memory/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29327877,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T03:52:29.695Z","status":"ssl_error","status_checked_at":"2026-02-11T03:52:23.094Z","response_time":97,"last_error":"SSL_read: 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":[],"created_at":"2025-02-01T07:28:01.617Z","updated_at":"2026-02-11T06:03:39.103Z","avatar_url":"https://github.com/dirheimerb.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JsonDataStore \n\nA simple key-value store using JSON files for storage and a binary search tree for in-memory data management. The JsonDataStore provides a convenient way to persist data across application runs, while maintaining fast in-memory data access.  This package provides a basic key-value store that persists data to JSON files, making it easy to store and retrieve data in a lightweight, human-readable format.\n\n## Features\n\n- Simple key-value store with basic CRUD operations (set, get, delete)\n- In-memory data storage using a binary search tree for efficient data access\n- Data persistence using JSON files\n\n## Installation\n\nInstall the package using npm:\n\n```bash\nnpm install json-db-memory\n```\n\n## Usage\n\nHere's a basic example of how to use the JsonDataStore:\n\n```typescript\nimport JsonDataStore from 'json-db-memory';\n\nconst store = new JsonDataStore('example');\n\n// Set key-value pairs\nstore.set('A', 'Alice');\nstore.set('B', 'Bob');\nstore.set('C', 'Charlie');\nstore.set('D', 'David');\n\n// Get values\nconsole.log(store.get('A')); // Output: 'Alice'\nconsole.log(store.get('B')); // Output: 'Bob'\nconsole.log(store.get('C')); // Output: 'Charlie'\nconsole.log(store.get('D')); // Output: 'David'\n\n// Update a value\nstore.set('A', 'Alicia');\nconsole.log(store.get('A')); // Output: 'Alicia'\n\n// Delete a key-value pair\nstore.delete('B');\nconsole.log(store.get('B')); // Output: null\n```\n\n## API\n\n`new JsonDataStore(fileName: string)`\nCreates a new data store instance. The data will be persisted in a JSON file with the provided file name in the data directory.\n\n- fileName: The name of the JSON file to store the data.\n\n`store.set(key: string, value: any)`\nSets a key-value pair in the data store. If the key already exists, the value will be updated.\n\n- key: The key to store the value.\n- value: The value to store.\n\n`store.get(key: string): any`\nRetrieves the value associated with the provided key. Returns null if the key does not exist.\n\n- key: The key to retrieve the value.\n- store.delete(key: string)\n\n`Deletes a key-value pair from the data store.`\n\n- key: The key to delete.\n\n### License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirheimerb%2Fjson-db-memory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdirheimerb%2Fjson-db-memory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdirheimerb%2Fjson-db-memory/lists"}