How to use the File function from gulp-util
Find comprehensive JavaScript gulp-util.File code examples handpicked from public code repositorys.
GitHub: eokeeffe/potree_vr
6 7 8 9 10 11 12 13 14
var rename = require('gulp-rename'); var uglify = require('gulp-uglify'); var gutil = require('gulp-util'); var through = require('through'); var os = require('os'); var File = gutil.File; //We need this one for the in-built webserver var connect = require('gulp-connect');
3
9
8
+ 3 other calls in file
GitHub: rschmukler/gulp-surgeon
1 2 3 4 5 6 7 8 9 10
path = require('path'), readFileSync = require('fs').readFileSync, through = require('through'); var PluginError = gutil.PluginError, File = gutil.File; var COMMENT_MAP = { css: { start: '/*', end: '*/' }, js: { start: '/*', end: '*/' }
1
8
2
93 94 95 96 97 98 99 100 101 102
path = prefixes[dtype] + "_" + index + ".html"; } else { path = dtype + ".html"; } newFile = new gutil.File({path: path}); newFile.contents = new Buffer(contents); stream.push(newFile);
0
5
23
+ 3 other calls in file
GitHub: helix-re/potree
4 5 6 7 8 9 10 11 12
const concat = require('gulp-concat'); const uglifyjs = require('uglify-es'); const composer = require('gulp-uglify/composer'); const gutil = require('gulp-util'); const through = require('through'); const File = gutil.File; const connect = require('gulp-connect'); const watch = require('glob-watcher'); const uglify = composer(uglifyjs, console);
989
0
10
85 86 87 88 89 90 91 92 93 94
## new File(obj) This is just [vinyl](https://github.com/wearefractal/vinyl) ```javascript var file = new gutil.File({ base: path.join(__dirname, './fixtures/'), cwd: __dirname, path: path.join(__dirname, './fixtures/test.coffee') });
104
0
2
GitHub: wmluke/gulp-useref
82 83 84 85 86 87 88 89 90 91
} } }, this); if (buffer.length) { joinedFile = new gutil.File({ cwd: file.cwd, base: file.base, path: path.join(file.base, name), contents: new Buffer(buffer.join(gutil.linefeed))
93
0
2
60 61 62 63 64 65 66 67 68 69
var cwd = process.cwd(); process.chdir(path.resolve(path.dirname(file.path))); raml2html.render(file.contents, options.config).then( function (output) { process.chdir(cwd); stream.push(new gutil.File({ base: file.base, cwd: file.cwd, path: gutil.replaceExtension(file.path, options.extension), contents: new Buffer(output)
4
5
9
GitHub: vincent314/nihongo3.14
64 65 66 67 68 69 70 71 72 73
.value() .join('\n'); console.log(csv); var outFile = new gutil.File(); outFile.path = 'kanjiTestForm.csv'; outFile.contents = new Buffer(csv); this.push(outFile);
0
0
0
65 66 67 68 69 70 71 72 73 74
} options.logLevel = 2; options.out = function( text ) { var outFile = new gutil.File({ path: file.relative, contents: new Buffer( text ) }); cb( null, outFile );
0
0
0
gulp-util.log is the most popular function in gulp-util (1090 examples)