File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,14 @@ Returns the hostname of the operating system.
1010
1111Returns the operating system name.
1212
13+ ### os.platform()
14+
15+ Returns the operating system platform.
16+
17+ ### os.arch()
18+
19+ Returns the operating system CPU architecture.
20+
1321### os.release()
1422
1523Returns the operating system release.
Original file line number Diff line number Diff line change @@ -30,3 +30,9 @@ exports.cpus = binding.getCPUs;
3030exports . type = binding . getOSType ;
3131exports . release = binding . getOSRelease ;
3232exports . getNetworkInterfaces = binding . getInterfaceAddresses ;
33+ exports . arch = function ( ) {
34+ return process . arch ;
35+ } ;
36+ exports . platform = function ( ) {
37+ return process . platform ;
38+ } ;
Original file line number Diff line number Diff line change @@ -44,6 +44,14 @@ var release = os.release();
4444console . log ( "release = " , release ) ;
4545assert . ok ( release . length > 0 ) ;
4646
47+ var platform = os . platform ( ) ;
48+ console . log ( "platform = " , platform ) ;
49+ assert . ok ( platform . length > 0 ) ;
50+
51+ var arch = os . arch ( ) ;
52+ console . log ( "arch = " , arch ) ;
53+ assert . ok ( arch . length > 0 ) ;
54+
4755if ( process . platform != 'sunos' ) {
4856 // not implemeneted yet
4957 assert . ok ( os . loadavg ( ) . length > 0 ) ;
@@ -54,7 +62,7 @@ if (process.platform != 'sunos') {
5462
5563var interfaces = os . getNetworkInterfaces ( ) ;
5664console . error ( interfaces ) ;
57- switch ( process . platform ) {
65+ switch ( platform ) {
5866 case 'linux' :
5967 assert . equal ( '127.0.0.1' , interfaces . lo . ip ) ;
6068 break ;
You can’t perform that action at this time.
0 commit comments