Update example.js to replace 'top' command with 'ping' for improved functionality. Minor formatting adjustment in stat-vit-term.js to enhance code readability.

This commit is contained in:
sebseb7
2025-08-12 00:28:18 +02:00
parent 83c912d8e0
commit e1887980d4
2 changed files with 5 additions and 4 deletions

View File

@@ -18,13 +18,13 @@ termSession.on('close', (code) => {
termSession.on('ready', () => { termSession.on('ready', () => {
console.log('Terminal ready\n'); console.log('Terminal ready\n');
// Top-Befehl starten // Ping starten
console.log('--- Starte top ---'); console.log('--- Ping starten ---');
termSession.input('top\n'); termSession.input('ping 127.0.0.1\n');
// Nach 3 Sekunden abbrechen // Nach 3 Sekunden abbrechen
setTimeout(() => { setTimeout(() => {
console.log('\n--- Top abbrechen mit ^C ---'); console.log('\n--- Ping abbrechen mit ^C ---');
termSession.input('^C'); termSession.input('^C');
}, 3000); }, 3000);

View File

@@ -2,6 +2,7 @@
import { EventEmitter } from 'events'; import { EventEmitter } from 'events';
import { spawn } from 'child_process'; import { spawn } from 'child_process';
class StatVitTerm extends EventEmitter { class StatVitTerm extends EventEmitter {
constructor(options = {}) { constructor(options = {}) {
super(); super();