Node.js & process.env & OS Platform checker
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的更多相关文章
- Node.js process 模块常用属性和方法
Node.js是常用的Javascript运行环境,本文和大家发分享的主要是Node.js中process 模块的常用属性和方法,希望通过本文的分享,对大家学习Node.js http://www.m ...
- 36.Node.js 工具模块--OS模块系统操作
转自:http://www.runoob.com/nodejs/nodejs-module-system.html Node.js os 模块提供了一些基本的系统操作函数.我们可以通过以下方式引入该模 ...
- [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 ...
- Node.js文档-os
获取操作系统相关信息 引用 const os = require('os') os.cpus() 获取当前机器的CPU信息 console.log(os.cpus()) 打印结果: [ { model ...
- 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 ...
- 极简 Node.js 入门 - 2.3 process
极简 Node.js 入门系列教程:https://www.yuque.com/sunluyong/node 本文更佳阅读体验:https://www.yuque.com/sunluyong/node ...
- Node.js 进程
process 是全局对象,能够在任意位置访问,是 EventEmitter 的实例. 退出状态码 当没有新的异步的操作等待处理时,Node 正常情况下退出时会返回状态码 0 .下面的状态码表示其他状 ...
- [转]Node.js tutorial in Visual Studio Code
本文转自:https://code.visualstudio.com/docs/nodejs/nodejs-tutorial Node.js tutorial in Visual Studio Cod ...
- Node.js精进(10)——性能监控(下)
本节会重点分析内存和进程奔溃,并且会给出相应的监控方法. 本系列所有的示例源码都已上传至Github,点击此处获取. 一.内存 虽然在 Node.js 中并不需要手动的对内存进行分配和销毁,但是在开发 ...
随机推荐
- QR Code Error Correction
QR Code Error Correction - QRStuff.com https://blog.qrstuff.com/2011/12/14/qr-code-error-correction ...
- int ping = 11; 限流 客户端验证与服务端是连接的
int ping = 11; ZooKeeper Programmer's Guide https://zookeeper.apache.org/doc/r3.1.2/zookeeperProgram ...
- 强制杀死进程后,进程相关的socket未必发送RST
强制杀死进程后,进程相关的socket未必发送RST
- springmvc框架java.lang.NoSuchMethodException问题解决
例子:https://blog.csdn.net/huaidandaidai1/article/details/81979704 原因: 在java中,如果一个类A没有自己写构造方法,那么java会自 ...
- python 拼接字
在编译脚本的时候,由于脚本的框架是统一写好的,于是乎用上了拼接字的功能, 本脚本实现的是波特率设置的自动化,利用的是正则表达式,TASK函数是统一写好的,此处只做调用 from Args import ...
- DNS欺骗&嗅探监听
承接上一章,除了arp欺骗之外对的欺骗方法 a)使用kali,对dns文件进行编辑 使用的欺骗工具是ettercap.对dns文件编辑: 添加一个A记录,解释到kali自身: b)进行欺骗 通过命令行 ...
- 省市县sql
create table SYS_AREA ( ID NUMBER(18) not null, AREA_CODE VARCHAR2(50) not null, AREA_NAME VARCHAR2( ...
- docker启动脚本
#!/bin/bash # 定义环境变量 export LANG="en_US.UTF-8" #统一格式化打印输出信息 printMsg(){ echo "$(date ...
- BGP总结(一)
0.AS 狭义:在RIP.OSPF和EIGRP等IGP协议中,AS表示只运行此单种协议的路由域 广义:运行多个IGP协议的路由域,多个IGP协议之间通过路由重发布来实现通信,AS和AS之间通过BGP来 ...
- MapReduce统计每个用户的使用总流量
1.原始数据 2.使用java程序 1)新建项目 2)导包 hadoop-2.7.3\share\hadoop\mapreduce +hsfs的那些包 +common 3.写项目 1)实体类 注:属性 ...