Node.js/process:修订间差异
来自康健生活
< Node.js
创建页面,内容为“== 标题文字 == == error == * TypeError: process.stdin.setRawMode is not a function : <syntaxhighlight lang="javascript"> if (process.stdin.isTTY) { process.std…” |
|||
| 第5行: | 第5行: | ||
if (process.stdin.isTTY) { | if (process.stdin.isTTY) { | ||
process.stdin.setRawMode(true); | process.stdin.setRawMode(true); | ||
}</syntaxhighlight> | }</syntaxhighlight><br> | ||
检测 process.stdout.isTTY<br> | |||
{{Shc_out|<syntaxhighlight lang="bash"> | |||
node -p -e "Boolean(process.stdout.isTTY)"</syntaxhighlight>|<syntaxhighlight lang="bash">true | |||
</syntaxhighlight>|$|/home/kangkk}} | |||
2021年7月15日 (四) 03:36的版本
标题文字
error
- TypeError: process.stdin.setRawMode is not a function
if (process.stdin.isTTY) { process.stdin.setRawMode(true); }
检测 process.stdout.isTTY
[jian@kang /home/kangkk]$
node -p -e "Boolean(process.stdout.isTTY)"
true
No categories