Node.js & process.env & OS Platform checker Node.js , process.env , OS Platform checker, OS, Platform, win32, API, js, node, cli,



Node.js & process.env & OS Platform checker

Window 10

Node.js & process.env & OS Platform checker_platform

Windows 7

ia32

CentOS

Node.js & process.env & OS Platform checker_OS_02


$ 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

Node.js & process.env & OS Platform checker_OS Platform checker_03

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

platform

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

Node.js & process.env & OS Platform checker_OS Platform checker_04

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​

Node.js & process.env & OS Platform checker_platform_05



win32

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

​https://techterms.com/definition/win32​

Node.js & process.env & OS Platform checker_OS_06

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​



xgqfrms