{"id":15356784,"url":"https://github.com/yeppha/node-protoc","last_synced_at":"2026-03-12T00:01:43.267Z","repository":{"id":17220044,"uuid":"81383949","full_name":"YePpHa/node-protoc","owner":"YePpHa","description":"A simple wrapper for the protoc.","archived":false,"fork":false,"pushed_at":"2025-08-20T19:55:21.000Z","size":2481,"stargazers_count":8,"open_issues_count":6,"forks_count":17,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T09:34:52.425Z","etag":null,"topics":["closure-compiler","javascript","linux","node","nodejs","osx","protobuf","protocol-buffers","windows"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/YePpHa.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":"2017-02-08T22:45:02.000Z","updated_at":"2025-08-20T19:55:25.000Z","dependencies_parsed_at":"2024-06-18T16:49:22.277Z","dependency_job_id":"2750a16a-890b-49c9-9081-ddf78ad83ea9","html_url":"https://github.com/YePpHa/node-protoc","commit_stats":{"total_commits":18,"total_committers":4,"mean_commits":4.5,"dds":"0.16666666666666663","last_synced_commit":"d1e35754a3c5e97127afa5726d4fd18aa2b185b7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/YePpHa/node-protoc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YePpHa%2Fnode-protoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YePpHa%2Fnode-protoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YePpHa%2Fnode-protoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YePpHa%2Fnode-protoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YePpHa","download_url":"https://codeload.github.com/YePpHa/node-protoc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YePpHa%2Fnode-protoc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30407769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T22:36:59.286Z","status":"ssl_error","status_checked_at":"2026-03-11T22:36:57.544Z","response_time":84,"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":["closure-compiler","javascript","linux","node","nodejs","osx","protobuf","protocol-buffers","windows"],"created_at":"2024-10-01T12:29:55.918Z","updated_at":"2026-03-12T00:01:43.258Z","avatar_url":"https://github.com/YePpHa.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Protocol Buffers for Node\nA wrapper in Node for the compiled protoc from https://github.com/protocolbuffers/protobuf.\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e Starting with version v21.0.x, the npm package [protoc](https://www.npmjs.com/package/protoc)\n\u003e is maintained in the repository https://github.com/timostamm/protobuf-npm.\n\u003e\n\u003e You can install the latest version with:\n\u003e\n\u003e ```\n\u003e npm install --save-dev protoc@latest\n\u003e npx protoc --version\n\u003e ```\n\u003e\n\u003e Note that the JavaScript generator has been removed from `protoc`, and lives in a\n\u003e separate repository now: https://github.com/protocolbuffers/protobuf-javascript\n\u003e Consequently, the package `protoc` no longer provides an API to generate JavaScript\n\u003e code, but you can easily achieve the same functionality with a small function.\n\u003e \n\u003e \u003cdetails\u003e\u003csummary\u003eExample script to call protoc from JS\u003c/summary\u003e\n\u003e\n\u003e ```ts\n\u003e import { spawnSync } from \"node:child_process\";\n\u003e import { mkdtempSync, readdirSync, statSync } from \"node:fs\";\n\u003e import { join } from \"node:path\";\n\u003e import { tmpdir } from \"node:os\";\n\u003e\n\u003e function compile(files: string[]): string[] {\n\u003e   const out = mkdtempSync(join(tmpdir(), \"protoc-output\"));\n\u003e   // Just as an example, use --php_out to generate PHP code\n\u003e   const ret = spawnSync(\n\u003e     \"protoc\", [\"--php_out=\" + out, ...files],\n\u003e     { encoding: \"utf8\"},\n\u003e   );\n\u003e   if (ret.status !== 0) {\n\u003e     throw new Error(ret.stderr);\n\u003e   }\n\u003e   return readdirSync(out, { recursive: true, encoding: \"utf8\" }).filter((f) =\u003e\n\u003e     statSync(join(out, f)).isFile(),\n\u003e   );\n\u003e }\n\u003e\n\u003e // Run with `npx node example.ts`\n\u003e console.log(compile([\"proto/msg.proto\"])); // [ 'Msg.php', 'GPBMetadata/Proto/Msg.php' ]\n\u003e ```\n\n\u003c/details\u003e\n\n\n\nThe information below applies to the package `protoc` version 1.1.3 and earlier:\n\n## Version\nIt's currently using Protocol Buffers `v3.20.3`.\n\n## Platforms\nGoogle only provides binary files for Windows, Linux and OSX in x86_64 and x86_32.\n\n## Examples\nThere's currently no documentation. Hopefully this example will help.\n\n```JavaScript\nvar protoc = require(\"protoc\");\n\nprotoc.library([\"path/to/file.proto\", \"path/to/file2.proto\"], function(err, files) {\n  if (err) {\n    console.error(err);\n    return;\n  }\n\n  // Handle the JavaScript Vinyl files.\n  // These files can be used in Google Closure Compiler,\n  // but they require the files in\n  // https://github.com/google/protobuf/tree/master/js\n  \n  // ...\n});\n```\n\nIt's also possible to directly call the protoc binary file:\n```\nnpx protoc --help\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeppha%2Fnode-protoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyeppha%2Fnode-protoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeppha%2Fnode-protoc/lists"}