Skip to content

Commit

Permalink
Use native os.tmpDir that is available since node 0.8.0+.
Browse files Browse the repository at this point in the history
This fixes #22.
  • Loading branch information
arthurschreiber committed Jan 16, 2014
1 parent be3aa49 commit 980b92f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 2 additions & 4 deletions lib/temp.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
var fs = require('fs'),
os = require('osenv'),
os = require('os'),
path = require('path'),
cnst = require('constants');

/* HELPERS */

var RDWR_EXCL = cnst.O_CREAT | cnst.O_TRUNC | cnst.O_RDWR | cnst.O_EXCL;

var environmentVariables = ['TMPDIR', 'TMP', 'TEMP'];

var generateName = function(rawAffixes, defaultPrefix) {
var affixes = parseAffixes(rawAffixes, defaultPrefix);
var now = new Date();
Expand Down Expand Up @@ -168,7 +166,7 @@ var createWriteStream = function(affixes) {

/* EXPORTS */
// Settings
exports.dir = path.resolve(os.tmpdir());
exports.dir = path.resolve(os.tmpDir());
exports.track = track;
// Functions
exports.mkdir = mkdir;
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@
"lib": "lib"
},
"engines": [
"node >=0.6.0"
"node >=0.8.0"
],
"main": "./lib/temp",
"dependencies": {
"rimraf": "~2.1.4",
"osenv": "0.0.3"
"rimraf": "~2.1.4"
},
"keywords": ["temporary", "tmp", "temp", "tempdir", "tempfile",
"tmpdir", "tmpfile", "data", "processing",
Expand Down

0 comments on commit 980b92f

Please sign in to comment.