Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
stream(options = {}) {
const out = new Stream();
const streams = [];
out._streams = streams;
out.destroy = () => {
let i = streams.length;
while (i--) {
streams[i].destroy();
}
};
// Create a list of all transports for this instance.
this.transports
.filter(transport => !!transport.stream)
.forEach(transport => {
const str = transport.stream(options);
if (!str) {
it('should work on a core Stream', function(done) {
var testStream = new Stream.Stream();
inspectStream(testStream).should.equal('');
done();
});
stream(options = {}) {
const file = path.join(this.dirname, this.filename);
const stream = new Stream();
const tail = {
file,
start: options.start
};
stream.destroy = tailFile(tail, (err, line) => {
if (err) {
return stream.emit('error', err);
}
try {
stream.emit('data', line);
line = JSON.parse(line);
stream.emit('log', line);
} catch (e) {
stream.emit('error', e);
module.exports = (file) => {
const buffer = Buffer.alloc(64 * 1024)
const decode = new StringDecoder('utf8')
const stream = new Stream()
let pos = 0
stream.readable = true
stream.destroy = () => {
stream.destroyed = true
stream.emit('end')
stream.emit('close')
}
fs.open(file, 'a+', '0644', async (err, fd) => {
if (err) {
stream.emit('error', err)
stream.destroy()
return
}
module.exports = (options, iter) => {
const buffer = Buffer.alloc(64 * 1024);
const decode = new StringDecoder('utf8');
const stream = new Stream();
let buff = '';
let pos = 0;
let row = 0;
if (options.start === -1) {
delete options.start;
}
stream.readable = true;
stream.destroy = () => {
stream.destroyed = true;
stream.emit('end');
stream.emit('close');
};
fs.open(options.file, 'a+', '0644', (err, fd) => {
stream(options = {}) {
const stream = new Stream();
options = {
method: 'stream',
params: options
};
if (options.params.path) {
options.path = options.params.path;
delete options.params.path;
}
if (options.params.auth) {
options.auth = options.params.auth;
delete options.params.auth;
}
let buff = '';
stream(options = {}) {
const stream = new Stream();
options = {
method: 'stream',
params: options
};
if (options.params.path) {
options.path = options.params.path;
delete options.params.path;
}
if (options.params.auth) {
options.auth = options.params.auth;
delete options.params.auth;
}
let buff = '';