Nodejs os: Difference between revisions

From wikinotes
No edit summary
No edit summary
 
Line 19: Line 19:
os.hostname()          // hostname
os.hostname()          // hostname
os.networkInterfaces()  // { "lo1": [ ... ] }
os.networkInterfaces()  // { "lo1": [ ... ] }
</syntaxhighlight>
</blockquote><!-- Machine Info -->
= Operating System =
<blockquote>
<syntaxhighlight lang="javascript">
os.platform()          // linux, freebsd, darwin, win32, ...
os.platform()          // linux, freebsd, darwin, win32, ...
os.version()
os.release()
os.tmpdir()
</syntaxhighlight>
</syntaxhighlight>
</blockquote><!-- Machine Info -->
</blockquote><!-- Operating System -->

Latest revision as of 20:59, 31 July 2021

Documentation

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

Machine Info

os.arch()               // 'x64'
os.cpus()               // [ { ..cpuinfo.. }, {...}, ... ]
os.freemem()
os.totalmem()

os.hostname()           // hostname
os.networkInterfaces()  // { "lo1": [ ... ] }

Operating System

os.platform()           // linux, freebsd, darwin, win32, ...
os.version()
os.release()
os.tmpdir()