rl.on('close', function() { // Print the welcome screen. util.log(''); util.log(fs.readFileSync('welcome.txt').toString().green); });
rl.on('line', function(line) { util.log( line.substring(0,4) + line.substring(4, 30).cyan.bold + line.substring(30, 33) + line.substring(33, 42).green.bold + line.substring(42) ); });
constructor(Server){ let CommandSender = new ConsoleCommandSender(Server); let rl = readline.createInterface({ input: process.stdin }); rl.on("line", (input) => { Server.getCommandMap().dispatchCommand(CommandSender, input); }); }
rl.on('line', function (line) { lineno++; if (line === div) { record.push(lineno, bucket.join('\n')); records.push(record); record = [lineno + 1]; bucket = []; } else { bucket.push(line); } });
const readFileByLine = (name, callback) => { const lineReader = readline.createInterface({ input: fs.createReadStream(path.resolve(__dirname, name)) }); lineReader.on('line', line => { callback && callback(line); }); }
rd2.on('line', (line) => { // console.log("Line by line:" , line); try { console.log("Parsing ", line); auto = parser.autoparse(line); console.log("Auto:", auto); } catch (err) { console.log(">> Error in line ", line, err); } }).on('close', () => { console.log("Data file exhausted"); console.log("Type 'quit' now:"); });
rl.on("line", function (line) { handleCommand(line); rl.prompt(); });
// Simulate SIGINT on Windows (see http://stackoverflow.com/questions/10021373/what-is-the-windows-equivalent-of-process-onsigint-in-node-js) createInterface({ input: process.stdin, output: process.stdout }) .on('SIGINT', () => process.emit('SIGINT'));
rl.on('SIGINT', function () { process.emit('SIGINT') })
rl.on("line", (line) => { parser.write(line); numLine++; });
lineReader.on('line', line => { if (line && line !== '') { blockedAddresses.push(line); } });
// 监听读取完成 rl.on("close", () => { console.log("chrome 占比:" + chromeNum / sum); });
lineReader.on('line', line => { if (line && line !== '' && line[0] !== '#') { whitelistedAddresses.push(line); } });
rl.on('SIGINT', function () { process.emit('SIGINT'); });