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

osenv

Package Overview
Dependencies
Maintainers
1
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.1 to 0.0.2

7

osenv.js
var isWindows = process.platform === 'win32'
console.error('isWindows = %j', isWindows, process.platform)
var windir = isWindows ? process.env.windir || 'C:\\Windows' : null

@@ -72,1 +71,7 @@ var path = require('path')

memo('editor', function () {
return process.env.EDITOR ||
process.env.VISUAL ||
(isWindows ? 'notepad.exe' : 'vi')
})

2

package.json
{
"name": "osenv",
"version": "0.0.1",
"version": "0.0.2",
"main": "osenv.js",

@@ -5,0 +5,0 @@ "directories": {

@@ -53,1 +53,7 @@ # osenv

executables.
## osenv.editor()
Return the executable name of the editor program. This uses the EDITOR
and VISUAL environment variables, and falls back to `vi` on Unix, or
`notepad.exe` on Windows.

@@ -22,2 +22,4 @@ // only run this test on windows

process.env.PS1 = '(o_o) $ '
process.env.EDITOR = 'edit'
process.env.VISUAL = 'visualedit'

@@ -49,3 +51,2 @@

var osenv = require('../osenv.js')
console.error('osenv.home', osenv.home())
t.equal(osenv.tmpdir(), '/home/sirUser/tmp')

@@ -58,3 +59,14 @@

t.equal(osenv.editor(), 'edit')
process.env.EDITOR = ''
delete require.cache[require.resolve('../osenv.js')]
var osenv = require('../osenv.js')
t.equal(osenv.editor(), 'visualedit')
process.env.VISUAL = ''
delete require.cache[require.resolve('../osenv.js')]
var osenv = require('../osenv.js')
t.equal(osenv.editor(), 'vi')
t.end()
})

@@ -25,2 +25,4 @@ // only run this test on windows

process.env.PROMPT = '(o_o) $ '
process.env.EDITOR = 'edit'
process.env.VISUAL = 'visualedit'

@@ -62,3 +64,14 @@ tap.test('basic windows sanity test', function (t) {

t.equal(osenv.editor(), 'edit')
process.env.EDITOR = ''
delete require.cache[require.resolve('../osenv.js')]
var osenv = require('../osenv.js')
t.equal(osenv.editor(), 'visualedit')
process.env.VISUAL = ''
delete require.cache[require.resolve('../osenv.js')]
var osenv = require('../osenv.js')
t.equal(osenv.editor(), 'notepad.exe')
t.end()
})
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