gulp-protobufjs
Converts protobuf files utilizing the protobufjs library.
Install with npm.
npm install --save-dev gulp-protobufjs
var gulp = require('gulp');
var gulpprotobuf = require('gulp-protobufjs');
gulp.task('default', function () {
return gulp.src('file.proto')
.pipe(gulpprotobuf())
.pipe(gulp.dest('out/'));
});gulpprotobuf(options)
options:input: (defaultprotobuf) Input format. Can be eitherprotobuforjsontarget: (defaultcommonjs) Output format. Can beamd,commonjs,js,jsonorproto.path: Optional path to specify where the base path for the proto imports is.encoding(defaultutf-8) Encoding which should be used to parse the input files.extThe file extension which should be set. Is being determined automatically if not given depending on thetargetconfiguration.
MIT @ Christoph Brand