mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
Implement os.isWindows
This commit is contained in:
parent
468042fc84
commit
9e31e0837e
@ -14,6 +14,10 @@ Returns the operating system name.
|
||||
|
||||
Returns the operating system release.
|
||||
|
||||
### os.isWindows
|
||||
|
||||
True on windows, false otherwise.
|
||||
|
||||
### os.uptime()
|
||||
|
||||
Returns the system uptime in seconds.
|
||||
|
@ -7,4 +7,5 @@ exports.freemem = binding.getFreeMem;
|
||||
exports.totalmem = binding.getTotalMem;
|
||||
exports.cpus = binding.getCPUs;
|
||||
exports.type = binding.getOSType;
|
||||
exports.release = binding.getOSRelease;
|
||||
exports.release = binding.getOSRelease;
|
||||
exports.isWindows = binding.isWindows;
|
@ -145,6 +145,12 @@ void OS::Initialize(v8::Handle<v8::Object> target) {
|
||||
NODE_SET_METHOD(target, "getCPUs", GetCPUInfo);
|
||||
NODE_SET_METHOD(target, "getOSType", GetOSType);
|
||||
NODE_SET_METHOD(target, "getOSRelease", GetOSRelease);
|
||||
|
||||
#ifdef __POSIX__
|
||||
target->Set(String::New("isWindows"), False());
|
||||
#else // __MINGW32__
|
||||
target->Set(String::New("isWindows"), True());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user