{"id":18498522,"url":"https://github.com/xpodev/quickstruct-js","last_synced_at":"2025-07-14T00:35:13.179Z","repository":{"id":205534242,"uuid":"714474928","full_name":"xpodev/quickstruct-js","owner":"xpodev","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-06T16:58:17.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-05-14T05:26:56.605Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xpodev.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":"2023-11-05T00:27:59.000Z","updated_at":"2023-11-05T00:32:59.000Z","dependencies_parsed_at":"2023-11-07T01:06:35.652Z","dependency_job_id":null,"html_url":"https://github.com/xpodev/quickstruct-js","commit_stats":null,"previous_names":["xpodev/quickstruct-js"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xpodev/quickstruct-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xpodev%2Fquickstruct-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xpodev%2Fquickstruct-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xpodev%2Fquickstruct-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xpodev%2Fquickstruct-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xpodev","download_url":"https://codeload.github.com/xpodev/quickstruct-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xpodev%2Fquickstruct-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265227900,"owners_count":23731060,"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-06T13:40:59.830Z","updated_at":"2025-07-14T00:35:13.121Z","avatar_url":"https://github.com/xpodev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quick Struct\n\nQuick Struct is a simple and fast way to create cpp structs in TypeScript.\n\n\u003e [!WARNING]  \n\u003e This package is still in development and is not published to npm and yarn yet.\n\n## Installation\n\n```bash\nnpm install quickstruct\n```\n\n## Usage\n\n```typescript\nimport { Int, Char, Struct, toBytes, fromBytes } from 'quickstruct';\n\n@Struct()\nclass SimpleStruct {\n  int1 = Int();\n  char1 = Char();\n  char2 = Char();\n}\n\nconst simpleStruct = new SimpleStruct();\nsimpleStruct.int1 = 1234;\nsimpleStruct.char1 = 'a'; // 97\nsimpleStruct.char2 = 600; // Overflow: 600 % 256 = 88\n\nconst bytes = toBytes(simpleStruct);\nconsole.log(bytes);\nconst simpleStruct2 = fromBytes(SimpleStruct, bytes);\nconsole.log({...simpleStruct2});\n\nconsole.log(simpleStruct2.int1 + 100);\n```\nOutput:\n```bash\n[ 210, 0, 0, 0, 97, 88 ]\nSimpleStruct { int1: 1234, char1: 'a', char2: 88 }\n1334\n```\n\n## Types\nThe following types are supported:\n| Type | Description | Displayed as |\n| --- | --- | --- |\n| Bool | 1 byte boolean | boolean |\n| Char | 1 byte character | string |\n| Byte | 1 byte character | number |\n| Short | 2 byte integer | number |\n| Int | 4 byte integer | number |\n| Float | 4 byte float | number |\n| Long | 8 byte integer | number |\n| Double | 8 byte float | number |\n| LongLong | 16 byte integer | number |\n| LongDouble | 16 byte float | number |\n| Str | String with dynamic length | string |\n| Null | 1 byte null | null |\n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxpodev%2Fquickstruct-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxpodev%2Fquickstruct-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxpodev%2Fquickstruct-js/lists"}