child_process

command の 標準入出力 覚書

child_process.spawn(command [, args] [, options]) command を 新規のプロセスで実行し、subprocess を生成する。 (command は 子プロセスとなる) options.stdio command の標準入出力先を設定する。 pipe: デフォルト。commandの標準入出力は、subproces…

child_processを使ってVimを起動する

コード const { spawn } = require('child_process'); const subprocess = spawn( 'sh', [ '-c', 'vim' ], { stdio: ['inherit', 'inherit', 'inherit'] } ); // 2秒後に終了させる setTimeout(() => { subprocess.kill(); // Does not terminate the Node.j…