Comparing version 0.0.3 to 0.1.0
11
osenv.js
var isWindows = process.platform === 'win32' | ||
var windir = isWindows ? process.env.windir || 'C:\\Windows' : null | ||
var path = require('path') | ||
var exec = require('child_process').exec | ||
var os = require('os') | ||
@@ -49,10 +49,3 @@ // looking up envs is a bit costly. | ||
memo('tmpdir', function () { | ||
var t = isWindows ? 'temp' : 'tmp' | ||
return process.env.TMPDIR || | ||
process.env.TMP || | ||
process.env.TEMP || | ||
( exports.home() ? path.resolve(exports.home(), t) | ||
: isWindows ? path.resolve(windir, t) | ||
: '/tmp' | ||
) | ||
return os.tmpDir() | ||
}) | ||
@@ -59,0 +52,0 @@ |
{ | ||
"name": "osenv", | ||
"version": "0.0.3", | ||
"version": "0.1.0", | ||
"main": "osenv.js", | ||
@@ -10,3 +10,3 @@ "directories": { | ||
"devDependencies": { | ||
"tap": "~0.2.5" | ||
"tap": "~0.4.9" | ||
}, | ||
@@ -13,0 +13,0 @@ "scripts": { |
@@ -26,3 +26,2 @@ // only run this test on windows | ||
tap.test('basic unix sanity test', function (t) { | ||
@@ -52,6 +51,2 @@ var osenv = require('../osenv.js') | ||
var osenv = require('../osenv.js') | ||
t.equal(osenv.tmpdir(), '/home/sirUser/tmp') | ||
delete require.cache[require.resolve('../osenv.js')] | ||
var osenv = require('../osenv.js') | ||
osenv.home = function () { return null } | ||
@@ -58,0 +53,0 @@ t.equal(osenv.tmpdir(), '/tmp') |
@@ -15,3 +15,3 @@ // only run this test on windows | ||
process.env.windir = 'C:\\windows' | ||
process.env.windir = 'c:\\windows' | ||
process.env.USERDOMAIN = 'some-domain' | ||
@@ -33,4 +33,2 @@ process.env.USERNAME = 'sirUser' | ||
var osenv = require('../osenv.js') | ||
t.equal(osenv.user(), | ||
@@ -58,9 +56,4 @@ process.env.USERDOMAIN + '\\' + process.env.USERNAME) | ||
var osenv = require('../osenv.js') | ||
t.equal(osenv.tmpdir(), 'C:\\Users\\sirUser\\temp') | ||
process.env.TEMP = '' | ||
delete require.cache[require.resolve('../osenv.js')] | ||
var osenv = require('../osenv.js') | ||
osenv.home = function () { return null } | ||
t.equal(osenv.tmpdir(), 'C:\\windows\\temp') | ||
t.equal(osenv.tmpdir(), 'c:\\windows\\temp') | ||
@@ -67,0 +60,0 @@ t.equal(osenv.editor(), 'edit') |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
7
0
69
10092
189
2