mirror of
https://github.com/protobufjs/protobuf.js.git
synced 2025-12-08 20:58:55 +00:00
25 lines
587 B
JavaScript
25 lines
587 B
JavaScript
"use strict";
|
|
var pbjs = require("../cli/pbjs");
|
|
|
|
[
|
|
"google/protobuf/api.proto",
|
|
"google/protobuf/descriptor.proto",
|
|
"google/protobuf/source_context.proto",
|
|
"google/protobuf/type.proto",
|
|
|
|
"google/api/annotations.proto",
|
|
"google/api/http.proto"
|
|
]
|
|
.forEach(function(file) {
|
|
var out = file.replace(/\.proto$/, ".json");
|
|
pbjs.main([
|
|
"--target", "json",
|
|
"--sparse",
|
|
"--out", out,
|
|
file
|
|
], function(err) {
|
|
if (err)
|
|
throw err;
|
|
process.stdout.write("pbjs: " + file + " -> " + out + "\n");
|
|
});
|
|
}); |