構文
- child_process.exec(command [、options] [、callback])
- child_process.execFile(file [、args] [、options] [、callback])
- child_process.fork(modulePath [、args] [、options])
- child_process.spawn(command [、args] [、options])
- child_process.execFileSync(file [、args] [、options])
- child_process.execSync(コマンド[、options])
- child_process.spawnSync(command [、args] [、options])
備考
子プロセスを扱う場合、すべての非同期メソッドはChildProcess
インスタンスを返しますが、すべての同期バージョンは実行されたものの出力を返します。 Node.js内の他の同期操作と同様に、エラーが発生すると、それはスローされます。
子プロセスによるファイルまたはコマンドの実行 関連する例