Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

osenv

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

osenv - npm Package Compare versions

Comparing version 0.0.3 to 0.1.0

.npmignore

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc