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.
|
Returns the operating system release.
|
||||||
|
|
||||||
|
### os.isWindows
|
||||||
|
|
||||||
|
True on windows, false otherwise.
|
||||||
|
|
||||||
### os.uptime()
|
### os.uptime()
|
||||||
|
|
||||||
Returns the system uptime in seconds.
|
Returns the system uptime in seconds.
|
||||||
|
@ -8,3 +8,4 @@ exports.totalmem = binding.getTotalMem;
|
|||||||
exports.cpus = binding.getCPUs;
|
exports.cpus = binding.getCPUs;
|
||||||
exports.type = binding.getOSType;
|
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, "getCPUs", GetCPUInfo);
|
||||||
NODE_SET_METHOD(target, "getOSType", GetOSType);
|
NODE_SET_METHOD(target, "getOSType", GetOSType);
|
||||||
NODE_SET_METHOD(target, "getOSRelease", GetOSRelease);
|
NODE_SET_METHOD(target, "getOSRelease", GetOSRelease);
|
||||||
|
|
||||||
|
#ifdef __POSIX__
|
||||||
|
target->Set(String::New("isWindows"), False());
|
||||||
|
#else // __MINGW32__
|
||||||
|
target->Set(String::New("isWindows"), True());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user