zemirco / json2csv

Convert json to csv with column titles
http://zemirco.github.io/json2csv
MIT License
2.71k stars 365 forks source link

Output file format #179

Closed Shavindra closed 7 years ago

Shavindra commented 7 years ago

When I run the translation-export task output file I get is .json not .csv? how can I ouput .csv?

var gulp = require('gulp');
var csv2json = require('gulp-csv-to-json');
var options = {};
var config = require('./config.json');

gulp.task('translation-import', function () {
    return gulp
        .src('app/i18n/csv/*.csv')
        .pipe(csv2json(options))
        .pipe(gulp.dest('app/i18n/json'));
});

var json2csv = require('gulp-json2csv');
gulp.task('translation-export', function() {
    return gulp.src('app/i18n/json/*.json')
        .pipe(json2csv())
        .pipe(gulp.dest('app/i18n/csv/'))
});
knownasilya commented 7 years ago

I don't think that module works because this module doesn't handle streams. We have an alternate (less maintained) version that does and that module should be using it. https://github.com/zemirco/json2csv-stream

If it doesn't use streams, then there is some issue with that module, see https://github.com/vajahath/gulp-json2csv and file an issue there.