javascript - TypeError:cannot read property 'on' of undefined -


i have gulp task read data file , write file.

for doing :

    var gulp = require('gulp');      var fs = require('fs');     gulp.task('readfile', function() {     return gulp.src('app/dataconfog.json')         .pipe(fs.readfile("app/dataconfog.json",  function(err, data){             fs.writefile('app/scripts/apiconfig.js', data);         }))         .pipe(gulp.dest('./dest/')) }) 

but getting following error:

enter image description here

any appreciated

try using this

var fs = require("fs");  gulp.task('dosometing', function() {    return gulp.src(dirs.src + '/templates/*.html')     .pipe(fs.readfile("path/to/file.something", "utf-8", function(err, _data) {       //do data     }))    .pipe(gulp.dest('destination/path'));   }); 

Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -