{"id":14961795,"url":"https://github.com/gd-com/utils","last_synced_at":"2025-05-07T07:33:24.147Z","repository":{"id":33508117,"uuid":"159079726","full_name":"gd-com/utils","owner":"gd-com","description":"Binary serialization helper godot and nodejs !","archived":false,"fork":false,"pushed_at":"2023-03-04T04:14:11.000Z","size":579,"stargazers_count":111,"open_issues_count":1,"forks_count":19,"subscribers_count":6,"default_branch":"v4","last_synced_at":"2025-04-10T02:58:22.818Z","etag":null,"topics":["gamedev","godot","godot-engine","godot3","godot4","networking","nodejs"],"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/gd-com.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"2018-11-25T22:15:36.000Z","updated_at":"2024-11-11T19:18:16.000Z","dependencies_parsed_at":"2024-06-20T19:06:45.808Z","dependency_job_id":"084071b5-7773-4e6a-8b51-6f4ab6828bfa","html_url":"https://github.com/gd-com/utils","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gd-com%2Futils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gd-com%2Futils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gd-com%2Futils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gd-com%2Futils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gd-com","download_url":"https://codeload.github.com/gd-com/utils/tar.gz/refs/heads/v4","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252833591,"owners_count":21811214,"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":["gamedev","godot","godot-engine","godot3","godot4","networking","nodejs"],"created_at":"2024-09-24T13:27:44.418Z","updated_at":"2025-05-07T07:33:24.120Z","avatar_url":"https://github.com/gd-com.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![GM-Com](./img/logo.png) @gd-com/utils\n\nBinary serialization helper godot and nodejs !\n\nWritten with this [api](https://docs.godotengine.org/en/latest/tutorials/misc/binary_serialization_api.html)\n\n## Requirements\n\n- Godot 4.0 or greater\n- NodeJS 16 LTS or greater\n\nFor Godot 3 go *[@gd-com/utils v3](https://github.com/gd-com/utils/tree/v3)*\n\n## How to install\n\n`npm install --save @gd-com/utils`\n\n## Examples\n\n### What is certs-generator ?\nThis is a Godot project which is just used to generate SSL certificates to test TCP UDP and Websocket in \"secure\" mode\n\n### Basic vs Advanced\n\n- **Basic** is a simple example who explain how to send variant\n- **Advanced** is a more complex example who explain how to send custom packets\n\n## Available from gdCom\n\n### Helpers\n\n| Method | Description                                                                                                                                 | Return                                           |\n|-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------|\n| prefixWithLength(buffer)       | Prefix the buffer passed in parameter by its size (required only for TCP)                                                                   |  Buffer |\n| StreamTcp | To optimize Godot send from time to time several packets in the same packet (only for TCP), to deserialize well it is necessary to use this | Class       | \n\n\n### Encode and Decode\n\n#### - getX\n| Method | Return |\n|-------------------------------|------------------------------|\n| getVar(buffer, offset = 0) | Object {   value,   length } |\n| get8(buffer, offset = 0) | Object {   value,   length } |\n| get16(buffer, offset = 0) | Object {   value,   length } |\n| get32(buffer, offset = 0) | Object {   value,   length } |\n| get64(buffer, offset = 0) | Object {   value,   length } |\n| getU8(buffer, offset = 0) | Object {   value,   length } |\n| getU16(buffer, offset = 0) | Object {   value,   length } |\n| getU32(buffer, offset = 0) | Object {   value,   length } |\n| getU64(buffer, offset = 0) | Object {   value,   length } |\n| getFloat(buffer, offset = 0) | Object {   value,   length } |\n| getDouble(buffer, offset = 0) | Object {   value,   length } |\n| getString(buffer, offset = 0) | Object {   value,   length } |\n\n#### - putX\n| Method | Return |\n|-------------------------------|------------------------------|\n| putVar(value, type) | Buffer |\n| put8(value) | Buffer |\n| put16(value) | Buffer |\n| put32(value) | Buffer |\n| put64(value) | Buffer |\n| putU8(value) | Buffer |\n| putU16(value) | Buffer |\n| putU32(value) | Buffer |\n| putU64(value) | Buffer |\n| putFloat(value) | Buffer |\n| putDouble(value) | Buffer |\n| putString(value) | Buffer |\n\n#### TYPE\n| Name | Value |\n|-------------------------------|------|\n| NULL | 0    |\n| BOOL | 1    |\n| INTEGER | 2    |\n| FLOAT | 3    |\n| STRING | 4    |\n| VECTOR2 | 5    |\n| RECT2 | 6    |\n| VECTOR3 | 7    |\n| TRANSFORM2D | 8    |\n| PLANE | 9    |\n| QUATERNION | 10   |\n| AABB | 11   |\n| BASIS | 12   |\n| TRANSFORM | 13   |\n| COLOR | 14   |\n| NODE_PATH | 15   |\n| RID // unsupported | 16   |\n| OBJECT // unsupported | 17   |\n| DICTIONARY | 18   |\n| ARRAY | 19   |\n| RAW_ARRAY | 20   |\n| INT_32_ARRAY | 21   |\n| INT_64_ARRAY | 22   |\n| FLOAT_32_ARRAY | 23   |\n| FLOAT_64_ARRAY | 24   |\n| STRING_ARRAY | 25   |\n| VECTOR2_ARRAY | 26   |\n| VECTOR3_ARRAY | 27   |\n| COLOR_ARRAY | 28   |\n| MAX | 29   |\n\n## Test\n```\ngit clone git@github.com:gd-com/utils.git gd-com-utils\ncd gd-com-utils\nnpm install or yarn install\nnpm run lint \u0026\u0026 npm run test\n```\n\n## Contributing\nPlease read [CONTRIBUTING](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## TODO \u0026 CHANGELOG\n[CHANGELOG](CHANGELOG.md)\n[TODO](TODO.md)\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n\n## Thanks\n* Godot\n* Godot France\n* GDQuest\n* IG-Dev\n* **Salsa2k** for the [initial work](https://github.com/salsa2k/godotserver)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgd-com%2Futils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgd-com%2Futils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgd-com%2Futils/lists"}