@inquirer/external-editor 3.0.5 → 3.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -3
- package/dist/index.js +4 -4
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -9,21 +9,53 @@ A Node.js module to edit a string with the user's preferred text editor using $V
|
|
|
9
9
|
|
|
10
10
|
<table>
|
|
11
11
|
<tr>
|
|
12
|
-
<th>npm</th>
|
|
13
12
|
<th>yarn</th>
|
|
13
|
+
<th>pnpm</th>
|
|
14
14
|
</tr>
|
|
15
15
|
<tr>
|
|
16
16
|
<td>
|
|
17
17
|
|
|
18
18
|
```sh
|
|
19
|
-
|
|
19
|
+
yarn add @inquirer/external-editor
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
</td>
|
|
23
23
|
<td>
|
|
24
24
|
|
|
25
25
|
```sh
|
|
26
|
-
|
|
26
|
+
pnpm add @inquirer/external-editor
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
</td>
|
|
30
|
+
</tr>
|
|
31
|
+
<tr>
|
|
32
|
+
<th>bun</th>
|
|
33
|
+
<th>deno</th>
|
|
34
|
+
</tr>
|
|
35
|
+
<tr>
|
|
36
|
+
<td>
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
bun add @inquirer/external-editor
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
</td>
|
|
43
|
+
<td>
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
deno add npm:@inquirer/external-editor
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
</td>
|
|
50
|
+
</tr>
|
|
51
|
+
<tr>
|
|
52
|
+
<th colSpan="2">npm</th>
|
|
53
|
+
</tr>
|
|
54
|
+
<tr>
|
|
55
|
+
<td colSpan="2">
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
npm install @inquirer/external-editor
|
|
27
59
|
```
|
|
28
60
|
|
|
29
61
|
</td>
|
package/dist/index.js
CHANGED
|
@@ -5,8 +5,8 @@ import path from 'node:path';
|
|
|
5
5
|
import os from 'node:os';
|
|
6
6
|
import { randomUUID } from 'node:crypto';
|
|
7
7
|
import iconv from 'iconv-lite';
|
|
8
|
-
import { CreateFileError, LaunchEditorError, ReadFileError, RemoveFileError, } from
|
|
9
|
-
import { parseEditorCommand } from
|
|
8
|
+
import { CreateFileError, LaunchEditorError, ReadFileError, RemoveFileError, } from './errors.js';
|
|
9
|
+
import { parseEditorCommand } from './parse-editor-command.js';
|
|
10
10
|
export { CreateFileError, LaunchEditorError, ReadFileError, RemoveFileError };
|
|
11
11
|
export function edit(text = '', fileOptions) {
|
|
12
12
|
return new ExternalEditor(text, fileOptions).run();
|
|
@@ -31,8 +31,8 @@ export class ExternalEditor {
|
|
|
31
31
|
constructor(text = '', fileOptions = {}) {
|
|
32
32
|
this.text = text;
|
|
33
33
|
this.fileOptions = fileOptions;
|
|
34
|
-
this.editor = parseEditorCommand(process.env['VISUAL']
|
|
35
|
-
process.env['EDITOR']
|
|
34
|
+
this.editor = parseEditorCommand(process.env['VISUAL'] ||
|
|
35
|
+
process.env['EDITOR'] ||
|
|
36
36
|
(process.platform.startsWith('win') ? 'notepad' : 'vim'));
|
|
37
37
|
}
|
|
38
38
|
run() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inquirer/external-editor",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.7",
|
|
4
4
|
"description": "Edit a string with the users preferred text editor using $VISUAL or $ENVIRONMENT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"answer",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"yo",
|
|
47
47
|
"zsh"
|
|
48
48
|
],
|
|
49
|
-
"homepage": "https://github.com/SBoudrias/Inquirer.js/blob/
|
|
49
|
+
"homepage": "https://github.com/SBoudrias/Inquirer.js/blob/HEAD/packages/external-editor/README.md",
|
|
50
50
|
"license": "MIT",
|
|
51
51
|
"author": "Simon Boudrias <admin@simonboudrias.com>",
|
|
52
52
|
"repository": {
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"@repo/tsconfig": "0.0.0",
|
|
80
80
|
"@types/chardet": "^1.0.0",
|
|
81
81
|
"@types/node": "^26.1.1",
|
|
82
|
-
"typescript": "^
|
|
82
|
+
"typescript": "^7.0.2"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"@types/node": ">=18"
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
},
|
|
95
95
|
"main": "./dist/index.js",
|
|
96
96
|
"types": "./dist/index.d.ts",
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "672b77f0486388d7f5c35487d89a5ff63f4c54dd"
|
|
98
98
|
}
|