~ubuntu-branches/ubuntu/trusty/nodejs/trusty

« back to all changes in this revision

Viewing changes to lib/os.js

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2013-08-14 00:16:46 UTC
  • mfrom: (7.1.40 sid)
  • Revision ID: package-import@ubuntu.com-20130814001646-bzlysfh8sd6mukbo
Tags: 0.10.15~dfsg1-4
* Update 2005 patch, adding a handful of tests that can fail on
  slow platforms.
* Add 1004 patch to fix test failures when writing NaN to buffer
  on mipsel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
// USE OR OTHER DEALINGS IN THE SOFTWARE.
21
21
 
22
22
var binding = process.binding('os');
 
23
var util = require('util');
23
24
 
 
25
exports.endianness = binding.getEndianness;
24
26
exports.hostname = binding.getHostname;
25
27
exports.loadavg = binding.getLoadAvg;
26
28
exports.uptime = binding.getUptime;
30
32
exports.type = binding.getOSType;
31
33
exports.release = binding.getOSRelease;
32
34
exports.networkInterfaces = binding.getInterfaceAddresses;
 
35
 
33
36
exports.arch = function() {
34
37
  return process.arch;
35
38
};
 
39
 
36
40
exports.platform = function() {
37
41
  return process.platform;
38
42
};
39
43
 
40
 
exports.getNetworkInterfaces = function() {
41
 
  require('util')._deprecationWarning('os',
42
 
    'os.getNetworkInterfaces() is deprecated - use os.networkInterfaces()');
 
44
exports.tmpdir = function() {
 
45
  return process.env.TMPDIR ||
 
46
         process.env.TMP ||
 
47
         process.env.TEMP ||
 
48
         (process.platform === 'win32' ? 'c:\\windows\\temp' : '/tmp');
 
49
};
 
50
 
 
51
exports.tmpDir = exports.tmpdir;
 
52
 
 
53
exports.getNetworkInterfaces = util.deprecate(function() {
43
54
  return exports.networkInterfaces();
44
 
};
 
55
}, 'getNetworkInterfaces is now called `os.networkInterfaces`.');
 
56
 
 
57
exports.EOL = process.platform === 'win32' ? '\r\n' : '\n';