Node.js/系统判断:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
创建页面,内容为“== 引言 == {{leftrightflex|<syntaxhighlight lang="javascript"> const os = require('os'); if (os.type() == 'Windows_NT') { console.log('windows'); } else if (os.t…”
 
Kangkk​(留言 | 贡献)
小 文字替换 -“{{leftrightflex|”替换为“{{Double-columns|”
标签:ReplaceText 移动版编辑 移动版网页编辑
 
第1行: 第1行:
== 引言 ==
== 引言 ==
{{leftrightflex|<syntaxhighlight lang="javascript">
{{Double-columns|<syntaxhighlight lang="javascript">
const os = require('os');
const os = require('os');
if (os.type() == 'Windows_NT') {
if (os.type() == 'Windows_NT') {

2026年11月26日 (四) 07:46的最新版本

引言

const os = require('os');
if (os.type() == 'Windows_NT') {
  console.log('windows');
} else if (os.type() == 'Darwin') {
  console.log('mac');
} else if (os.type() == 'Linux') {
  console.log('linux');
} else{
  console.log('no support');
}
linux