Node.js/process:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
Kangkk​(留言 | 贡献)
 
第5行: 第5行:
if (process.stdin.isTTY) {
if (process.stdin.isTTY) {
   process.stdin.setRawMode(true);
   process.stdin.setRawMode(true);
}</syntaxhighlight><br>
}</syntaxhighlight>
检测 process.stdout.isTTY<br>
: 检测 process.stdout.isTTY
{{Shc_out|<syntaxhighlight lang="bash">
: {{Shc_out|<syntaxhighlight lang="bash">
node -p -e "Boolean(process.stdout.isTTY)"</syntaxhighlight>|<syntaxhighlight lang="bash">true
node -p -e "Boolean(process.stdout.isTTY)"</syntaxhighlight>|<syntaxhighlight lang="bash">true
</syntaxhighlight>|$|/home/kangkk}}
</syntaxhighlight>|$|/home/kangkk}}