mirror of
https://github.com/valitydev/thrift-ts.git
synced 2024-11-06 08:45:17 +00:00
Convert thrift IDL file to .d.ts 😃
bin | ||
lib | ||
src | ||
test | ||
.gitignore | ||
package.json | ||
README.md | ||
tsconfig.json | ||
tslint.json |
#thrift-ts
thrift-ts
is a typescript compiler that compile *.thrift files to *.d.ts files.
It should works with thrift --gen js:node
commands.
##Installation
$ npm install -g thrift-ts
##How to use ###CLI
thrift-ts Model.thrift
###Node
import thriftTs from 'thriftTs';
import fs = require('fs');
const filename = './Model.thrift';
const files = thriftTs({
filename,
content: fs.readFileSync(filename),
});
console.log(files);
// [{ filename: 'Model_types.d.ts', content: '...'}]