first commit

This commit is contained in:
s.golasch
2023-08-01 13:49:46 +02:00
commit 1fc239fd54
20238 changed files with 3112246 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
'use strict';
var fs = require('graceful-fs');
var stripBom = require('strip-bom-stream');
var lazystream = require('lazystream');
function streamFile(file, opt, cb) {
if (typeof opt === 'function') {
cb = opt;
opt = {};
}
var filePath = file.path;
file.contents = new lazystream.Readable(function() {
return fs.createReadStream(filePath);
});
if (opt.stripBOM) {
file.contents = file.contents.pipe(stripBom());
}
cb(null, file);
}
module.exports = streamFile;