ウェブエンジニア珍道中

日々の技術的に関する経験を書いていきます。脱線もしますが助けになれば幸いです。

2018-08-09から1日間の記事一覧

Node.js上でのlinuxコマンドの叩き方

Node.js上でlinuxコマンドの叩き方を備忘録として残します。 実行方法 child_processをrequireしてexecメソッドを使います。 const exec = require('child_process').exec; exec("echo 'hogehoge'", (error, stdout, stderr) => { if (error) { console.log(…