0
点赞
收藏
分享

微信扫一扫

LeetCode 2050. Parallel Courses III【记忆化搜索,动态规划,拓扑排序】困难

梦想家们 2023-07-30 阅读 54
node.js

默认输出是Buffer对象

const { execSync } = require('child_process')

let out = execSync("echo 'hi'")
console.log(out);
// <Buffer 68 69 0a>

需要转为字符串

const { execSync } = require('child_process')

let out = execSync("echo 'hi'")
console.log(out.toString());
// hi

参考文章

  1. https://www.runoob.com/nodejs/nodejs-process.html
  2. https://blog.csdn.net/weixin_43972437/article/details/130643741
举报

相关推荐

0 条评论