Skip to content

Commit 3fe6aba

Browse files
committed
os: rename tmpDir() to tmpdir() for consistency
Make the casing consistent with the other os.* functions but keep os.tmpDir() around as an alias.
1 parent 60f18ed commit 3fe6aba

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

doc/api/os.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Provides a few basic operating-system related utility functions.
66

77
Use `require('os')` to access this module.
88

9-
## os.tmpDir()
9+
## os.tmpdir()
1010

1111
Returns the operating system's default directory for temp files.
1212

lib/os.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ exports.platform = function() {
4141
return process.platform;
4242
};
4343

44-
exports.tmpDir = function() {
44+
exports.tmpdir = function() {
4545
return process.env.TMPDIR ||
4646
process.env.TMP ||
4747
process.env.TEMP ||
4848
(process.platform === 'win32' ? 'c:\\windows\\temp' : '/tmp');
4949
};
5050

51+
exports.tmpDir = exports.tmpdir;
52+
5153
exports.getNetworkInterfaces = util.deprecate(function() {
5254
return exports.networkInterfaces();
5355
}, 'getNetworkInterfaces is now called `os.networkInterfaces`.');

test/simple/test-os.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ process.env.TMPDIR = '/tmpdir';
3131
process.env.TMP = '/tmp';
3232
process.env.TEMP = '/temp';
3333
var t = ( process.platform === 'win32' ? 'c:\\windows\\temp' : '/tmp' );
34-
assert.equal(os.tmpDir(), '/tmpdir');
34+
assert.equal(os.tmpdir(), '/tmpdir');
3535
process.env.TMPDIR = '';
36-
assert.equal(os.tmpDir(), '/tmp');
36+
assert.equal(os.tmpdir(), '/tmp');
3737
process.env.TMP = '';
38-
assert.equal(os.tmpDir(), '/temp');
38+
assert.equal(os.tmpdir(), '/temp');
3939
process.env.TEMP = '';
40-
assert.equal(os.tmpDir(), t);
40+
assert.equal(os.tmpdir(), t);
4141

4242
var endianness = os.endianness();
4343
console.log('endianness = %s', endianness);

0 commit comments

Comments
 (0)