Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 18 lines (14 sloc) 429 Bytes
#! /usr/bin/env node
// Create a simple log of incoming CodeGeneratorRequest messages
const protocPlugin = require('../src/index')
protocPlugin(protos => protos.map(proto => {
console.error(`Working on ${proto.pb_package}.`)
return {
name: `${proto.pb_package}.json`,
content: JSON.stringify(proto, null, 2)
}
}))
.then(() => {
// I use error, because stdout is used for plugin
console.error('Complete.')
})