How to use the gulp-util.File function in gulp-util

To help you get started, we’ve selected a few gulp-util examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github noahmiller / gulp-scsslint / test / main.js View on Github external
var getFile = function(filePath) {
   filePath = 'test/' + filePath;
   return new gutil.File({
      path: filePath,
      cwd: 'test/',
      base: path.dirname(filePath),
      contents: null
   });
};
github kamranahmedse / gulp-css-tailor / index.js View on Github external
function endStream() {
    var generatedCss = tailor.generateLazy(options);
    var cssContent = options.minifyOutput ? generatedCss.minified : generatedCss.formatted;

    var outputFile = new gutil.File({
      cwd: firstFile.cwd,
      base: firstFile.base,
      path: path.join(firstFile.base, options.filename),
      contents: new Buffer(cssContent)
    });

    this.push(outputFile);
    this.emit('data', outputFile);
    this.emit('end');
  }
github dylanb / gulp-coverage / index.js View on Github external
reporters.forEach(function(opts) {
                if (typeof opts === 'string') opts = { reporter: opts };
                var reporter = opts.reporter || 'html';
                var outfile = opts.outFile || 'coverage.' + reporter;
                file = new gutil.File({
                    base: path.join(__dirname, './'),
                    cwd: __dirname,
                    path: path.join(__dirname, './', outfile),
                    contents: new Buffer(cover.reporters[reporter](data.coverage))
                });
                file.coverage = data.coverage;
                this.push(file);
            }, this);
            cb();
github paeckchen / paeckchen / packages / gulp-paeckchen / src / host.ts View on Github external
public writeFile(path: string, content: string): void {
    this.addFile(new File({
      path,
      contents: new Buffer(content)
    }));
  }
github power-assert-js / espower / gulpfile.js View on Github external
finish: through.obj(pass, function (callback) {
            var file = new gutil.File(filespec);
            file.contents = new Buffer(log);
            this.push(file);
            process.stdout.write = orig;
            log = '';
            orig = null;
            callback();
        })
    };

gulp-util

Utility functions for gulp plugins

MIT
Latest version published 7 years ago

Package Health Score

50 / 100
Full package analysis

Similar packages