{"id":32117077,"url":"https://github.com/worotyns/atoms","last_synced_at":"2026-02-18T20:32:08.679Z","repository":{"id":214654524,"uuid":"722468675","full_name":"worotyns/atoms","owner":"worotyns","description":"Simple complex object aka atoms storage via persist, restore in fs","archived":false,"fork":false,"pushed_at":"2024-01-12T15:51:04.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-25T11:50:14.229Z","etag":null,"topics":["deno","framework","pure-object","storage"],"latest_commit_sha":null,"homepage":"","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/worotyns.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}},"created_at":"2023-11-23T08:08:00.000Z","updated_at":"2023-12-29T16:59:58.000Z","dependencies_parsed_at":"2024-01-15T23:25:42.885Z","dependency_job_id":null,"html_url":"https://github.com/worotyns/atoms","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"816aca83d8fa99347446d4ecf0cbc40eb497c290"},"previous_names":["worotyns/atoms"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/worotyns/atoms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worotyns%2Fatoms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worotyns%2Fatoms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worotyns%2Fatoms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worotyns%2Fatoms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/worotyns","download_url":"https://codeload.github.com/worotyns/atoms/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worotyns%2Fatoms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29594259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T18:54:29.675Z","status":"ssl_error","status_checked_at":"2026-02-18T18:50:50.517Z","response_time":162,"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":["deno","framework","pure-object","storage"],"created_at":"2025-10-20T16:27:22.434Z","updated_at":"2026-02-18T20:32:08.670Z","avatar_url":"https://github.com/worotyns.png","language":"TypeScript","readme":"# Atoms\n\n## Overview\n\nAtoms is a simple and lightweight micro \"framework\" designed for easy\nprototyping and interaction with objects. It consists of just two methods,\n_restore_ and _persist_, and an interface to implement _IAtom_.\n\n## Features\n\n- **Simplicity:** Define your classes with just two methods, making it easy to\n  create small programs without unnecessary complexity.\n\n- **Persistence:** Easily persist and restore the state of your objects without\n  the need for databases. Use the file system to preview data and query with\n  tools like `jq` or similar.\n\n- **Extensibility:** Implement the _IAtom_ interface by extending the _Atom_\n  class to enable seamless serialization and deserialization.\n\n- **Drivers:** Includes drivers for memory, file system, object storage (in\n  progress), and Deno KV storage (in progress).\n\n- **Serializers:** Currently supports JSON serialization.\n\n## Example Codes (see /examples directory)\n\n### Simple Structure (One File)\n\n```typescript\nimport { Atom, createFs } from 'https://deno.land/x/atoms/mod.ts';\n\nconst { persist, restore } = createFs('./tmp');\n\nclass Simple extends Atom\u003cSimple\u003e {\n  public readonly name: string = 'example';\n  public readonly age: number = 33;\n\n  sayNameAndAge() {\n    return `${this.name} is ${this.age} yo`;\n  }\n\n  static deserialize(value: PropertiesOnly\u003cSimple\u003e): Simple {\n    return Object.assign(\n      new Simple(),\n      Atom.parse\u003cSimple\u003e(value),\n    );\n  }\n}\n\nconst simple = new Simple();\nawait persist(simple);\nconst restored = await restore(simple.identity, Simple);\n```\n\n## Nested structure (multiple files on save)\n\n```ts\nimport { Atom, createFs } from 'https://deno.land/x/atoms/mod.ts';\n\nconst { persist, restore } = createFs('./tmp');\n\nclass MySample extends Atom\u003cMySample\u003e {\n  public readonly name: string = 'example';\n  public readonly age: number = 33;\n  public nested: MySecondClass = new MySecondClass();\n\n  static deserialize(value: PropertiesOnly\u003cMySample\u003e): MySample {\n    const temporary = Atom.parse\u003cMySample\u003e(value);\n    const newSample = new MySample();\n\n    Object.assign(newSample, temporary, {\n      nested: MySecondClass.deserialize(temporary.nested),\n    });\n\n    return newSample;\n  }\n}\n\nclass MySecondClass extends Atom\u003cMySecondClass\u003e {\n  public collection: Array\u003cnumber\u003e = [1, 2, 3, 4];\n\n  static deserialize(value: PropertiesOnly\u003cMySecondClass\u003e): MySecondClass {\n    const temporary = Atom.parse(value);\n    const newSample = new MySecondClass();\n\n    Object.assign(newSample, temporary);\n    return newSample;\n  }\n}\n\nconst mySample = new MySample();\nawait persist(mySample);\nconst restored = await restore(mySample.identity, MySample);\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworotyns%2Fatoms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworotyns%2Fatoms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworotyns%2Fatoms/lists"}