An easy way to compile thrift idl files using simple configuration.
npm install -g thrift-generator
thrift-generator --config=config-file.json
npm install --save-dev thrift-generator
{
"thrift-generator": {
"log": "debug",
"generators": [
{
"language": [
"js:node",
"java"
],
"idl": "**/.thrift",
"output": "./dist"
}
]
}
}
{
"scripts": {
"thrift": "thrift-generator"
}
}
Log level, can be 'info' or debug (default: info)
Thrift cli executable path (default: thrift)
Array of glob patterns to ignore while searching for thrift idl files.
Array of thrift genereation commands
Language to generate, can be a string or an array of languages
Path to idl file/s. supports globbing (default: */.thrift)
Output folder. If generator.language is an array, then files will be genereated at output/gen-*, otherwise, files will be genereated at output (no gen-* will be created).