@h4ad/node-modules-packer
Version:
<h1 align="center"> 🚀 Node Modules Packer </h1>
24 lines • 723 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.StringStream = void 0;
const stream_1 = require("stream");
// credits: https://github.com/feross/string-to-stream
class StringStream extends stream_1.Readable {
constructor(str, encoding) {
super();
this.str = str;
this.encoding = encoding;
this.encoding = encoding || 'utf8';
}
_read() {
if (!this.ended) {
process.nextTick(() => {
this.push(Buffer.from(this.str, this.encoding));
this.push(null);
});
this.ended = true;
}
}
}
exports.StringStream = StringStream;
//# sourceMappingURL=string-stream.js.map