gettemporaryfilepath
Advanced tools
Comparing version 0.0.1 to 1.0.0
@@ -11,8 +11,7 @@ // Fragments of the seemingly abandoned https://github.com/bruce/node-temp/blob/master/lib/temp.js patched to use os.tmpDir() if available: | ||
// Memoized because those fs.realpathSync calls are expensive: | ||
var tempDir; | ||
function getTempDir() { | ||
if (!tempDir) { | ||
if (os && os.tmpDir) { | ||
tempDir = os.tmpDir(); | ||
// Memoized because those fs.realpathSync calls are expensive: | ||
if (!getTempDir.tmpDir) { | ||
if (os && os.tmpdir) { | ||
getTempDir.tempDir = os.tmpdir(); | ||
} else { | ||
@@ -23,11 +22,11 @@ var environmentVariableNames = ['TMPDIR', 'TMP', 'TEMP']; | ||
if (environmentVariableValue) { | ||
tempDir = fs.realpathSync(environmentVariableValue); | ||
getTempDir.tempDir = fs.realpathSync(environmentVariableValue); | ||
break; | ||
} | ||
} | ||
if (!tempDir) { | ||
if (!getTempDir.tempDir) { | ||
if (process.platform === 'win32') { | ||
tempDir = fs.realpathSync('c:\\tmp'); | ||
getTempDir.tempDir = fs.realpathSync('c:\\tmp'); | ||
} else { | ||
tempDir = fs.realpathSync('/tmp'); | ||
getTempDir.tempDir = fs.realpathSync('/tmp'); | ||
} | ||
@@ -37,3 +36,3 @@ } | ||
} | ||
return tempDir; | ||
return getTempDir.tempDir; | ||
} | ||
@@ -76,1 +75,3 @@ | ||
module.exports = getTemporaryFilePath; | ||
module.exports.getTempDir = getTempDir; |
{ | ||
"name": "gettemporaryfilepath", | ||
"version": "0.0.1", | ||
"description": "Generate temporary file names in your OS' temporary dir", | ||
"main": "lib/getTemporaryFilePath.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/papandreou/node-gettemporaryfilepath.git" | ||
}, | ||
"keywords": [ | ||
"temporary", | ||
"tmp", | ||
"temp", | ||
"os", | ||
"tempdir", | ||
"windows", | ||
"linux", | ||
"osx" | ||
], | ||
"author": "Andreas Lind Petersen <andreas@one.com>", | ||
"license": "BSD" | ||
"name": "gettemporaryfilepath", | ||
"version": "1.0.0", | ||
"description": "Generate temporary file names in your OS' temporary dir", | ||
"main": "lib/getTemporaryFilePath.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/papandreou/node-gettemporaryfilepath.git" | ||
}, | ||
"keywords": [ | ||
"temporary", | ||
"tmp", | ||
"temp", | ||
"os", | ||
"tempdir", | ||
"windows", | ||
"linux", | ||
"osx" | ||
], | ||
"author": "Andreas Lind Petersen <andreas@one.com>", | ||
"license": "BSD", | ||
"devDependencies": { | ||
"mocha": "=1.18.2", | ||
"sinon": "=1.9.0", | ||
"unexpected": "=3.0.1", | ||
"unexpected-sinon": "=3.0.0" | ||
} | ||
} |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
8819
6
140
2
4
7