{"id":26332579,"url":"https://github.com/steelydylan/electron-typed-store","last_synced_at":"2025-03-15T23:29:27.435Z","repository":{"id":281494059,"uuid":"945471571","full_name":"steelydylan/electron-typed-store","owner":"steelydylan","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-09T14:18:42.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T14:19:54.045Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/steelydylan.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":"2025-03-09T14:03:18.000Z","updated_at":"2025-03-09T14:15:58.000Z","dependencies_parsed_at":"2025-03-09T14:30:00.464Z","dependency_job_id":null,"html_url":"https://github.com/steelydylan/electron-typed-store","commit_stats":null,"previous_names":["steelydylan/electron-typed-store"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steelydylan%2Felectron-typed-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steelydylan%2Felectron-typed-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steelydylan%2Felectron-typed-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steelydylan%2Felectron-typed-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steelydylan","download_url":"https://codeload.github.com/steelydylan/electron-typed-store/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806137,"owners_count":20350773,"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":[],"created_at":"2025-03-15T23:29:27.033Z","updated_at":"2025-03-15T23:29:27.405Z","avatar_url":"https://github.com/steelydylan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Electron Typed Store\n\nElectron Typed Store is a simple key-value storage solution for Electron applications, utilizing JSON files to persist data. It provides a straightforward API for storing, retrieving, and managing data in the user's application data directory.\n\n## Features\n\n- Asynchronous operations for data management\n- Type-safe storage with TypeScript\n- Easy integration with Electron applications\n- Supports setting, getting, deleting, and clearing data\n\n## Installation\n\nTo install Electron Typed Store, use npm:\n\n```bash\n$ npm install electron-typed-store\n```\n\n## Usage\n\nHere's a basic example of how to use Electron Typed Store in your Electron application:\n\n```typescript\nimport { Store } from 'electron-typed-store';\n\ninterface MyData {\n  username: string;\n  age: number;\n}\n\nconst store = new Store\u003cMyData\u003e('myData.json', { username: 'defaultUser', age: 0 });\n\nasync function main() {\n  await store.set('username', 'john_doe');\n  const username = await store.get('username');\n  console.log(username); // Output: john_doe\n\n  await store.set('age', 30);\n  const age = await store.get('age');\n  console.log(age); // Output: 30\n\n  const allData = await store.getAll();\n  console.log(allData); // Output: { username: 'john_doe', age: 30 }\n\n  await store.delete('username');\n  await store.clear();\n}\n\nmain();\n```\n\n## API\n\n### `constructor(fileName: string, defaultValues: T)`\n\nCreates a new store instance.\n\n- `fileName`: The name of the JSON file to store data.\n- `defaultValues`: An object containing default key-value pairs.\n\n### `store.set`\n\nSets a value for a specified key.\n\n### `store.get`\n\nRetrieves the value for a specified key.\n\n### `store.delete`\n\nDeletes a specified key from the store.\n\n### `store.getAll`\n\nReturns all stored data.\n\n### `store.clear`\n\nClears all data from the store.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request on GitHub.\n\n## Repository\n\n[GitHub Repository](https://github.com/steelydylan/electron-typed-store)\n\n## Author\n\nDeveloped by steelydylan.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteelydylan%2Felectron-typed-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteelydylan%2Felectron-typed-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteelydylan%2Felectron-typed-store/lists"}