dts-generator icon indicating copy to clipboard operation
dts-generator copied to clipboard

how to use it in gulp ???

Open insetCoad opened this issue 9 years ago • 3 comments
trafficstars

hay guys do u have any gulp plugin or working on that or something . or their is some way to use it with gulp ??

insetCoad avatar Jul 31 '16 16:07 insetCoad

gulp.task('definitions', function(done) {
    var exec = require('child_process').exec;
    var cmd = 'node ./node_modules/dts-generator/bin/dts-generator --name myproject --baseDir src/typescript --project ./ --out typings/myproject/myproject.d.ts';
    exec(cmd, function(error, stdout, stderr){
        console.log(stdout);
        console.log(stderr);
        done();
    });
});```

provided you have dts-generator as a local dependency. if you have installed it globally just use dts-generator instead of node ./...

mendrik avatar Aug 31 '16 07:08 mendrik

Or we can require it dts_gen = require('dts-generator').default; and use

dts_gen({
        name: 'lib_name',
        baseDir: 'src/',
        project: './',
        out: 'lib/dts/lib_name.d.ts'
    }); 

dmitry-kurmanov avatar Oct 19 '16 08:10 dmitry-kurmanov

Can we open a new api for usages that do not write to disk?

ulivz avatar Mar 12 '20 09:03 ulivz