Convert thrift IDL file to .d.ts 😃
Go to file
2017-11-07 20:48:49 +08:00
bin add getBasePath 2017-06-16 14:38:35 +08:00
lib update 2017-04-24 17:56:24 +08:00
src fix(include): 多级引用目录问题 2017-11-07 20:48:12 +08:00
test test(include): 补充用例 2017-11-07 20:48:49 +08:00
.gitignore init 2017-04-18 10:12:37 +08:00
package.json test(include): 补充用例 2017-11-07 20:48:49 +08:00
README.md update 2017-04-24 17:56:24 +08:00
tsconfig.json update 2017-04-24 17:56:24 +08:00
tslint.json init 2017-04-18 10:12:37 +08:00

#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: '...'}]