Node.js & process.env & OS Platform checker

Window 10

Windows 7

ia32

CentOS


$ node
# process.env

node-env-reader.js


#!/usr/bin/env node // console.log(`process`, JSON.stringify(process, null, 4)); let {
arch,
platform,
} = process; console.log(`process.arch `, arch);
// x64
console.log(`process.platform `, platform);
// win32
// linux // console.log(`process.env`, JSON.stringify(process.env, null, 4)); let {
OS,
} = process.env; console.log(`process.env.OS `, OS);
// Windows_NT
// undefined // node node-env-reader.js // git --version // shell.exec(`git --version`);
// Windows PC & git version 2.21.0.windows.1 // shell.exec(`git --version`);
// 202 Linux & git version 1.7.1 // process.arch x64
// process.platform linux
// process.env.OS undefined

OS

https://nodejs.org/api/os.html

arch

https://nodejs.org/api/os.html#os_os_arch

platform

https://nodejs.org/api/os.html#os_os_platform

Platform = OS + Arch

https://superuser.com/questions/514459/platform-vs-operating-system

URL

https://nodejs.org/api/url.html#url_url_strings_and_url_objects


win32

https://en.wikipedia.org/wiki/Windows_API

https://techterms.com/definition/win32

Alternatively referred to as the Windows API and WinAPI, Win32 is the main set of Microsoft Windows APIs used for developing 32-bit applications.

https://www.computerhope.com/jargon/w/win32.htm


Node.js & process.env & OS Platform checker的更多相关文章

  1. Node.js process 模块常用属性和方法

    Node.js是常用的Javascript运行环境,本文和大家发分享的主要是Node.js中process 模块的常用属性和方法,希望通过本文的分享,对大家学习Node.js http://www.m ...

  2. 36.Node.js 工具模块--OS模块系统操作

    转自:http://www.runoob.com/nodejs/nodejs-module-system.html Node.js os 模块提供了一些基本的系统操作函数.我们可以通过以下方式引入该模 ...

  3. [Node.js] process.nextTick for converting sync to async

    For example we have a function to check the filesize: const fs = require('fs'); function fileSize (f ...

  4. Node.js文档-os

    获取操作系统相关信息 引用 const os = require('os') os.cpus() 获取当前机器的CPU信息 console.log(os.cpus()) 打印结果: [ { model ...

  5. how to config custom process.env in node.js

    how to config custom process.env in node.js process.env APP_ENV NODE_ENV https://nodejs.org/api/proc ...

  6. 极简 Node.js 入门 - 2.3 process

    极简 Node.js 入门系列教程:https://www.yuque.com/sunluyong/node 本文更佳阅读体验:https://www.yuque.com/sunluyong/node ...

  7. Node.js 进程

    process 是全局对象,能够在任意位置访问,是 EventEmitter 的实例. 退出状态码 当没有新的异步的操作等待处理时,Node 正常情况下退出时会返回状态码 0 .下面的状态码表示其他状 ...

  8. [转]Node.js tutorial in Visual Studio Code

    本文转自:https://code.visualstudio.com/docs/nodejs/nodejs-tutorial Node.js tutorial in Visual Studio Cod ...

  9. Node.js精进(10)——性能监控(下)

    本节会重点分析内存和进程奔溃,并且会给出相应的监控方法. 本系列所有的示例源码都已上传至Github,点击此处获取. 一.内存 虽然在 Node.js 中并不需要手动的对内存进行分配和销毁,但是在开发 ...

随机推荐

  1. (Oracle)预定义异常

    预定义异常: 为了 Oracle 开发和维护的方便,在 Oracle 异常中,为常见的异常码定义了对应的异常名称,称为预定义异常,常见的预定义异常有: 异常名称 异常码 描述 DUP_VAL_ON_I ...

  2. go mod 以及vscode解决被墙的插件问题

    https://blog.csdn.net/weixin_39003229/article/details/97638573?utm_medium=distribute.pc_relevant.non ...

  3. Centos搭建Hive

    Centos搭建Hive 一.Hive简介 二.安装Hive 2.1hive下载 2.2上传解压 2.3配置hive相关的环境变量 三.Mysql 3.1安装mysql connector 3.2 将 ...

  4. linux 高可用----keepalived+lvs

    什么是高可用? HA(high availability)即高可用性:就是在高可用集群中发生单点故障时,能够自动转移资源并切换服务,以保证服务一直在线的机制. LVS LVS:(linux virtu ...

  5. 1153 Decode Registration Card of PAT

    A registration card number of PAT consists of 4 parts: the 1st letter represents the test level, nam ...

  6. Codeforces Round #634 (Div. 3)

    D题想复杂了,花了好多时间,感觉也没时间看F了,就来写个题解蹭蹭访问量把^_^ 传送门:1335 A. Candies and Two Sisters 题意:你要把n个糖果分给两个人,两个人的糖果数不 ...

  7. 2020-2021 ICPC, NERC, Southern and Volga Russian Regional Contest (Online Mirror, ICPC Rules) D. Firecrackers (贪心,二分)

    题意:有个长度为\(n\)的监狱,犯人在位置\(a\),cop在位置\(b\),你每次可以向左或者向右移动一个单位,或者选择不动并在原地放一个爆竹\(i\),爆竹\(i\)在\(s[i]\)秒后爆炸, ...

  8. fiddler抓包+雷电模拟器 完成手机app抓包的配置

    1.下载最新版Fiddler,强烈建议在官网下载:https://www.telerik.com/download/fiddler 不下载最新版的话,配置起来会遇到很多问题,弄太麻烦了.因为我下载的是 ...

  9. Educational Codeforces Round 88 (Rated for Div. 2) E、Modular Stability 逆元+思维

    题目链接:E.Modular Stability 题意: 给你一个n数,一个k,在1,2,3...n里挑选k个数,使得对于任意非负整数x,对于这k个数的任何排列顺序,然后用x对这个排列一次取模,如果最 ...

  10. zoj3905 Cake

    Time Limit: 4 Seconds      Memory Limit: 65536 KB Alice and Bob like eating cake very much. One day, ...