Skip to content

Instantly share code, notes, and snippets.

@bytemain
Created May 17, 2021 08:52
Show Gist options
  • Save bytemain/bd01b1cca2ddef1c8fb3a9138a7b0a3b to your computer and use it in GitHub Desktop.
Save bytemain/bd01b1cca2ddef1c8fb3a9138a7b0a3b to your computer and use it in GitHub Desktop.
const fs = require('fs');
var readline = require('readline');
var stream = require('stream');
const buf = fs.readFileSync('./1.txt');
var bufferStream = new stream.PassThrough();
bufferStream.end(buf);
var rl = readline.createInterface({
input: bufferStream,
});
rl.on('line', function (line) {
if (line.includes('report_id')) {
console.log('content = ' + line);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment