Code Monkey home page Code Monkey logo

gulp-typescript-thrift's Introduction

Gulp-Typescript-Thrift

This gulp plugin generates typescript files from Thrift IDL.

Prerequisites

This plugin requires a recent Thrift compiler (e.g. 0.9.2) with typescript support installed on your path.

Usage

This plugin generates both .js files and the .d.ts files for typescript support.

Example usage:

gulp.task(“thrift”, function ()
{
    var tStream = new thrift();
    gulp.src(‘./thrift-src/*.thrift’)
        .pipe(tStream)
        .pipe(gulp.dest(‘./lib’));
    tStream.definitions.pipe(gulp.dest(‘typings/gen-thrift’));
}
);

This code snippet will import files from the thrift-src directory and generate .js files in the ./lib directory. Typescript defintions will be placed in the typings/gen-thrift directory.

In addition, the plugin generates a summary typescript file thrift.d.ts in this directory. This means in every file you will use the thrift definitions, you will only need to add

/// <reference path=”../typings/gen-thrift/thrift.d.ts” />

to include all typings.

Building

Naturally, this plugin uses gulp for its own build system.

$ npm install

should install all the necessary dev dependencies, including the typescript compiler required to build, and the command

$ gulp

Will build the plugin and place it in the build directory.

gulp-typescript-thrift's People

Contributors

no2chem avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.