新增调试信息

This commit is contained in:
2025-10-27 22:15:25 +08:00
parent ae62457d8c
commit 04642cb2f0
5479 changed files with 683397 additions and 3450 deletions
+22
View File
@@ -0,0 +1,22 @@
var splicer = require('../');
var through = require('through2');
var JSONStream = require('JSONStream');
var split = require('split');
var headerData = {};
var headers = through.obj(function (buf, enc, next) {
var line = buf.toString('utf8');
if (line === '') {
this.push(headerData);
pipeline.splice(1, 1, JSONStream.parse([ 'rows', true ]));
}
else {
var m = /^(\S+):(.+)/.exec(line);
var key = m && m[1].trim();
var value = m && m[2].trim();
if (m) headerData[key] = value;
}
next();
});
var pipeline = splicer([ split(), headers, JSONStream.stringify() ]);
process.stdin.pipe(pipeline).pipe(process.stdout);