mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-22 12:27:19 +00:00
22 lines
410 B
JavaScript
22 lines
410 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: new Buffer(string)
|
|
}));
|
|
this.push(null);
|
|
};
|
|
return src;
|
|
}
|
|
|
|
module.exports = {
|
|
streamFromString,
|
|
};
|