open-editor
Advanced tools
Comparing version 2.0.1 to 3.0.0
10
index.js
'use strict'; | ||
const childProcess = require('child_process'); | ||
const execa = require('execa'); | ||
const envEditor = require('env-editor'); | ||
@@ -58,3 +58,3 @@ const lineColumnPath = require('line-column-path'); | ||
const subProcess = childProcess.spawn(result.binary, result.arguments, { | ||
const subprocess = execa(result.binary, result.arguments, { | ||
detached: true, | ||
@@ -65,3 +65,3 @@ stdio | ||
// Fallback | ||
subProcess.on('error', () => { | ||
subprocess.on('error', () => { | ||
const result = make(files, { | ||
@@ -78,5 +78,5 @@ ...options, | ||
if (result.isTerminalEditor) { | ||
subProcess.on('exit', process.exit); | ||
subprocess.on('exit', process.exit); | ||
} else { | ||
subProcess.unref(); | ||
subprocess.unref(); | ||
} | ||
@@ -83,0 +83,0 @@ }; |
{ | ||
"name": "open-editor", | ||
"version": "2.0.1", | ||
"version": "3.0.0", | ||
"description": "Open files in your editor at a specific line and column", | ||
"license": "MIT", | ||
"repository": "sindresorhus/open-editor", | ||
"funding": "https://github.com/sponsors/sindresorhus", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
"url": "https://sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=8" | ||
"node": ">=10" | ||
}, | ||
@@ -48,11 +49,12 @@ "scripts": { | ||
"dependencies": { | ||
"env-editor": "^0.4.0", | ||
"env-editor": "^0.4.1", | ||
"execa": "^5.0.0", | ||
"line-column-path": "^2.0.0", | ||
"open": "^6.2.0" | ||
"open": "^7.3.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "^1.4.1", | ||
"tsd": "^0.7.2", | ||
"xo": "^0.24.0" | ||
"ava": "^2.4.0", | ||
"tsd": "^0.14.0", | ||
"xo": "^0.36.1" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# open-editor [![Build Status](https://travis-ci.org/sindresorhus/open-editor.svg?branch=master)](https://travis-ci.org/sindresorhus/open-editor) | ||
# open-editor | ||
@@ -18,3 +18,2 @@ > Open files in your editor at a specific line and column | ||
## Install | ||
@@ -26,3 +25,2 @@ | ||
## Usage | ||
@@ -43,6 +41,5 @@ | ||
## API | ||
### openEditor(files, [options]) | ||
### openEditor(files, options?) | ||
@@ -63,3 +60,3 @@ Open the given files in the user's editor at specific line and column if supported by the editor. It does not wait for the editor to start or quit. | ||
Type: `string`<br> | ||
Type: `string`\ | ||
Default: [Auto-detected](https://github.com/sindresorhus/env-editor) | ||
@@ -71,3 +68,3 @@ | ||
### openEditor.make(files, [options]) | ||
### openEditor.make(files, options?) | ||
@@ -80,3 +77,2 @@ Same as `openEditor()`, but returns an object with the binary name, arguments, and a flag indicating whether the editor runs in the terminal. | ||
## Related | ||
@@ -86,6 +82,1 @@ | ||
- [open](https://github.com/sindresorhus/open) - Open stuff like URLs, files, executables | ||
## License | ||
MIT © [Sindre Sorhus](https://sindresorhus.com) |
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
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
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
0
7251
4
76
+ Addedexeca@^5.0.0
+ Addedcross-spawn@7.0.5(transitive)
+ Addedexeca@5.1.1(transitive)
+ Addedget-stream@6.0.1(transitive)
+ Addedhuman-signals@2.1.0(transitive)
+ Addedis-docker@2.2.1(transitive)
+ Addedis-stream@2.0.1(transitive)
+ Addedis-wsl@2.2.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedmerge-stream@2.0.0(transitive)
+ Addedmimic-fn@2.1.0(transitive)
+ Addednpm-run-path@4.0.1(transitive)
+ Addedonetime@5.1.2(transitive)
+ Addedopen@7.4.2(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedstrip-final-newline@2.0.0(transitive)
+ Addedwhich@2.0.2(transitive)
- Removedis-wsl@1.1.0(transitive)
- Removedopen@6.4.0(transitive)
Updatedenv-editor@^0.4.1
Updatedopen@^7.3.0