Node.js & process.env & OS Platform checker Node.js , process.env , OS Platform checker, OS, Platform, win32, API, js, node, cli,
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
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 + Archhttps://superuser.com/questions/514459/platform-vs-operating-system
URL
https://nodejs.org/api/url.html#url_url_strings_and_url_objects
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
xgqfrms