Last Updated: September 21, 2017
·
5.087K
· skphilipp

Node.js module `os` examples

As there is no examples yet of what you can expect from the os module; Here's some samples directly from the command line, on a windows system:

C:\Users\Philipp>node
> var os = require('os');
undefined
> os.tmpdir()
'C:\\Users\\Philipp\\AppData\\Local\\Temp'
> os.endianness()
'LE'
> os.hostname()
'Philipp-PC'
> os.type()
'Windows_NT'
> os.platform()
'win32'
> os.arch()
'x64'
> os.release()
'6.1.7601'
> os.uptime()
1224.1885563
> os.loadavg()
[ 0, 0, 0 ]
> os.totalmem()
8544739328
> os.freemem()
6003707904