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:
@@ -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);
|
||||||
|
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user