添加 kit 子目录

This commit is contained in:
Cheney
2024-03-07 15:50:13 +08:00
parent e0c2ab8c1e
commit 5fd50792a0
24 changed files with 3143 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
/**
*
* child_process
* - exec 适合短时间命令,获取完整输出
* - execFile 适合实时交互
* - spawn 适合长时间命令
*
* shelljs - https://www.npmjs.com/package/shelljs
* execa - https://www.npmjs.com/package/execa
* ssh2 - https://www.npmjs.com/package/ssh2
*
*/
const { execSync } = require('child_process');
module.exports = {
execSync(cmd){
$logger.debug(`execSync ${cmd}`)
const output = execSync(cmd);
return output.toString()
}
}