{"id":21327394,"url":"https://github.com/wanadev/abitbol-serializable","last_synced_at":"2025-06-24T15:33:42.616Z","repository":{"id":57171990,"uuid":"50827635","full_name":"wanadev/abitbol-serializable","owner":"wanadev","description":"Serializable classes based on Abibol classes","archived":false,"fork":false,"pushed_at":"2024-04-22T07:47:43.000Z","size":350,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-23T09:50:26.799Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://wanadev.github.io/abitbol-serializable/","language":"JavaScript","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/wanadev.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":"2016-02-01T09:06:12.000Z","updated_at":"2024-06-03T14:40:18.400Z","dependencies_parsed_at":"2022-08-24T13:30:48.126Z","dependency_job_id":"b4c79032-b98a-46ad-87ca-d84826f66446","html_url":"https://github.com/wanadev/abitbol-serializable","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wanadev%2Fabitbol-serializable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wanadev%2Fabitbol-serializable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wanadev%2Fabitbol-serializable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wanadev%2Fabitbol-serializable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wanadev","download_url":"https://codeload.github.com/wanadev/abitbol-serializable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806072,"owners_count":20350775,"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":"2024-11-21T21:17:02.379Z","updated_at":"2025-03-16T00:13:37.666Z","avatar_url":"https://github.com/wanadev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# abitbol-serializable\n\n[![Lint and test](https://github.com/wanadev/abitbol-serializable/actions/workflows/node-ci.yml/badge.svg)](https://github.com/wanadev/abitbol-serializable/actions/workflows/node-ci.yml)\n[![NPM Version](http://img.shields.io/npm/v/abitbol-serializable.svg?style=flat)](https://www.npmjs.com/package/abitbol-serializable)\n[![License](http://img.shields.io/npm/l/abitbol-serializable.svg?style=flat)](https://github.com/wanadev/abitbol-serializable/blob/master/LICENSE)\n[![Discord](https://img.shields.io/badge/chat-Discord-8c9eff?logo=discord\u0026logoColor=ffffff)](https://discord.gg/BmUkEdMuFp)\n\n**Abitbol Serializable** is an [abitbol][] class that can serialize its\nproperties.\n\n**Features:**\n\n* Serialize / Unserialize all computed properties that have a getter and\n  a setter,\n* Skip properties annotated with `\"@serializable false\"`.\n* Use custom serialization function for specific properties.\n\n**Example Class:**\n\n```javascript\nvar SerializableClass = require(\"abitbol-serializable\");\n\nvar Person = SerializableClass.$extend({\n\n    __name__: \"Person\",  // The class name\n\n    __init__: function(params) {\n        this.$data.firstName = \"John\";\n        this.$data.lastName = \"DOE\";\n        this.$data.age = 0;\n        this.$super(params);\n    },\n\n    getFirstName: function() {\n        return this.$data.firstName;\n    },\n\n    setFirstName: function(firstName) {\n        this.$data.firstName = firstName;\n    },\n\n    getLastName: function() {\n        return this.$data.lastName;\n    },\n\n    setLastName: function(lastName) {\n        this.$data.lastName = lastName;\n    },\n\n    getAge: function() {\n        \"@serializable false\";\n        return this.$data.age;\n    },\n\n    setAge: function(age) {\n        this.$data.age = age;\n    }\n\n});\n```\n\n**Example Serialization:**\n\n```javascript\nvar john = new Person({\n    lastName: \"Wayne\",\n    age: 72\n});\n\njohn.serialize();\n\n// -\u003e {\n//        __name__: \"Person\",\n//        id: \"\u003can autogenerated uuid\u003e\",\n//        firstName: \"John\",\n//        lastName: \"Wayne\"\n//    }\n```\n\n[abitbol]: https://github.com/wanadev/abitbol\n\n\n## Install\n\nTo install Abitbol Serializable run the following command:\n\n    npm install abitbol-serializable\n\n\n## Documentation\n\n* https://wanadev.github.io/abitbol-serializable/\n\n\n## Contributing\n\n### Questions\n\nIf you have any question, you can:\n\n* [Open an issue on GitHub][gh-issue]\n* [Ask on discord][discord]\n\n### Bugs\n\nIf you found a bug, please [open an issue on Github][gh-issue] with as much information as possible.\n\n### Pull Requests\n\nPlease consider [filing a bug][gh-issue] before starting to work on a new feature. This will allow us to discuss the best way to do it. This is of course not necessary if you just want to fix some typo or small errors in the code.\n\n### Coding Style / Lint\n\nTo check coding style, run the follwoing command:\n\n    npm run lint\n\n### Tests\n\nTu run tests, use the following command:\n\n    npm run test\n\n\n[gh-issue]: https://github.com/wanadev/abitbol-serializable/issues\n[discord]: https://discord.gg/BmUkEdMuFp\n\n\n## Changelog\n\n* **[NEXT]** (changes on master that have not been released yet):\n\n    * Nothing yet ;)\n\n* **v2.1.0:**\n\n    * feat: Removed dependency to the uuid library. Use browser/Node's secure implementation if available, or a fallback one else (@flozz)\n    * feat: Only include used parts of lodash instead of the whole library (@flozz)\n\n* **v2.0.2:**\n\n    * feat: Added TypeScript type declaration for SerializableClass and serializer (@Pduhard, #26)\n    * misc: Updated dev dependencies (@dependabot)\n\n* **v2.0.1:**\n\n    * Updated dependencies (@jbghoul, #12)\n\n* **v2.0.0:**\n\n    * Updates `abitbol` dependency to 2.0.0\n\n* **v1.0.2:**\n\n    * Documentation site\n\n* **v1.0.1:**\n\n    * Updates `uuid` dependency to 3.0.0\n\n* **v1.0.0:**\n\n    * Initial release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwanadev%2Fabitbol-serializable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwanadev%2Fabitbol-serializable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwanadev%2Fabitbol-serializable/lists"}