{"id":19206890,"url":"https://github.com/pkoretic/protobufjs-qml","last_synced_at":"2025-05-12T17:28:20.187Z","repository":{"id":144904986,"uuid":"130504373","full_name":"pkoretic/protobufjs-qml","owner":"pkoretic","description":"protobufjs QML port","archived":false,"fork":false,"pushed_at":"2018-04-23T08:38:53.000Z","size":25,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-05T20:13:37.787Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pkoretic.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":"2018-04-21T19:09:18.000Z","updated_at":"2020-09-08T01:56:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"bb37e45b-b013-4830-b86c-97ba7b710bf4","html_url":"https://github.com/pkoretic/protobufjs-qml","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/pkoretic%2Fprotobufjs-qml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkoretic%2Fprotobufjs-qml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkoretic%2Fprotobufjs-qml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkoretic%2Fprotobufjs-qml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pkoretic","download_url":"https://codeload.github.com/pkoretic/protobufjs-qml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253786679,"owners_count":21964198,"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-09T13:17:21.214Z","updated_at":"2025-05-12T17:28:20.180Z","avatar_url":"https://github.com/pkoretic.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# protobufjs-qml\nThis is a port of [protobufjs minimal](https://github.com/dcodeIO/protobuf.js/tree/master/dist/minimal) for QML excluding Services support.\n\n## Usage\n\nBuild your .proto files in a static mode using [pbjs](https://github.com/dcodeIO/protobuf.js/tree/master/cli) (removes function wrap which prevents QML exposing the JS logic)\n\n```\npbjs -t static -w closure -o proto.js message.proto\n```\n\nAdd QML import to `proto.js` at the top (QML can't import in lowercase) and provide the needed\nreference:\n\n```\n.import \"protobuf.js\" as Protobuf\nvar $protobuf = Protobuf\n```\n\nSend a protobuf message using HTTP:\n\n```\n.import \"proto.js\" as PROTO\n\nvar Message = PROTO.$root[\"Message\"]\n\nvar errMsg = Message.verify(data)\nif (errMsg)\n    throw Error(errMsg)\n\nvar buffer = Message.encode(Message.create(data)).finish()\n\nvar xhr = new XMLHttpRequest\nxhr.open(\"POST\", 'http://localhost', true)\nxhr.onreadystatechange = function() {\n    if (xhr.readyState === XMLHttpRequest.DONE)\n        console.log(xhr.status, xhr.responseText)\n}\n\n// QML doesn't support binary data in XMLHTTPREQUEST send method as browsers do\nxhr.send(String.fromCharCode.apply(null, buffer))\n\n```\n## Notes\n\nFor porters and future work.\n\n - QML doesn't support module.exports or require\n - Uint8Array is not properly implemented(replaced with Array)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkoretic%2Fprotobufjs-qml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpkoretic%2Fprotobufjs-qml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkoretic%2Fprotobufjs-qml/lists"}