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 eitherprotobuf
orjson
target
: (defaultcommonjs
) Output format. Can beamd
,commonjs
,js
,json
orproto
.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.ext
The file extension which should be set. Is being determined automatically if not given depending on thetarget
configuration.
MIT @ Christoph Brand