1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-20 02:38:53 +00:00
Files
frontend/gulp/common/stream.js
2017-11-11 11:32:22 -08:00

22 lines
411 B
JavaScript

const stream = require('stream');
const gutil = require('gulp-util');
function streamFromString(filename, string) {
var src = stream.Readable({ objectMode: true });
src._read = function () {
this.push(new gutil.File({
cwd: '',
base: '',
path: filename,
contents: Buffer.from(string)
}));
this.push(null);
};
return src;
}
module.exports = {
streamFromString,
};