os: rename getNetworkInterfaces() to networkInterfaces()

This commit is contained in:
Ben Noordhuis 2011-11-01 17:23:17 +01:00
parent b4afe605f4
commit 37bb37d151
3 changed files with 13 additions and 3 deletions

View File

@ -109,7 +109,7 @@ Example inspection of os.cpus:
idle: 1072572010,
irq: 30 } } ]
### os.getNetworkInterfaces()
### os.networkInterfaces()
Get a list of network interfaces:

View File

@ -29,10 +29,20 @@ exports.totalmem = binding.getTotalMem;
exports.cpus = binding.getCPUs;
exports.type = binding.getOSType;
exports.release = binding.getOSRelease;
exports.getNetworkInterfaces = binding.getInterfaceAddresses;
exports.networkInterfaces = binding.getInterfaceAddresses;
exports.arch = function() {
return process.arch;
};
exports.platform = function() {
return process.platform;
};
var warnNetworkInterfaces = true;
exports.getNetworkInterfaces = function() {
if (warnNetworkInterfaces) {
console.error("os.getNetworkInterfaces() is deprecated - use os.networkInterfaces()");
console.trace();
warnNetworkInterfaces = false;
}
return exports.networkInterfaces();
};

View File

@ -63,7 +63,7 @@ if (process.platform != 'sunos') {
}
var interfaces = os.getNetworkInterfaces();
var interfaces = os.networkInterfaces();
console.error(interfaces);
switch (platform) {
case 'linux':