{"name":"@inquirer/editor","version":"4.2.23","keywords":["answer","answers","ask","base","cli","command","command-line","confirm","enquirer","generate","generator","hyper","input","inquire","inquirer","interface","iterm","javascript","menu","node","nodejs","prompt","promptly","prompts","question","readline","scaffold","scaffolder","scaffolding","stdin","stdout","terminal","tty","ui","yeoman","yo","zsh"],"author":{"name":"Simon Boudrias","email":"admin@simonboudrias.com"},"license":"MIT","_id":"@inquirer/editor@4.2.23","maintainers":[{"name":"sboudrias","email":"admin@simonboudrias.com"},{"name":"mischah","email":"mail@michael-kuehnel.de"}],"homepage":"https://github.com/SBoudrias/Inquirer.js/blob/main/packages/editor/README.md","bugs":{"url":"https://github.com/SBoudrias/Inquirer.js/issues"},"dist":{"shasum":"fe046a3bfdae931262de98c1052437d794322e0b","tarball":"http://registry-npm.ywwl.com/@inquirer/editor/download/@inquirer/editor-4.2.23.tgz","fileCount":9,"integrity":"sha512-aLSROkEwirotxZ1pBaP8tugXRFCxW94gwrQLxXfrZsKkfjOYC1aRvAZuhpJOb5cu4IBTJdsCigUlf2iCOu4ZDQ==","signatures":[{"sig":"MEYCIQCfapluzhtE1nmpkvbPPV3vBgu8APEz9fTt6KEEkGgP0QIhAI3TZmqoI2+q+Uodcy5huCP4bEBk92W0xMu+jKD8pw3L","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15104,"size":4412,"noattachment":false,"key":"/@inquirer/editor/-/@inquirer/editor-4.2.23.tgz"},"main":"./dist/commonjs/index.js","tshy":{"exclude":["src/**/*.test.ts"],"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"type":"module","types":"./dist/commonjs/index.d.ts","module":"./dist/esm/index.js","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},"./package.json":"./package.json"},"gitHead":"4731a373881368e2f701c41adc67bc83244bf89f","scripts":{"tsc":"tshy","attw":"attw --pack"},"_npmUser":{"name":"sboudrias","email":"admin@simonboudrias.com"},"repository":{"url":"git+https://github.com/SBoudrias/Inquirer.js.git","type":"git"},"_npmVersion":"lerna/9.0.0/node@v22.20.0+arm64 (darwin)","description":"Inquirer multiline editor prompt","directories":{},"sideEffects":false,"_nodeVersion":"22.20.0","dependencies":{"@inquirer/core":"^10.3.2","@inquirer/type":"^3.0.10","@inquirer/external-editor":"^1.0.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tshy":"^3.0.3","@repo/tsconfig":"workspace:*","@inquirer/testing":"^2.1.53","@arethetypeswrong/cli":"^0.18.2"},"peerDependencies":{"@types/node":">=18"},"peerDependenciesMeta":{"@types/node":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/editor_4.2.23_1762983668009_0.825588743535377","host":"s3://npm-registry-packages-npm-production"},"readme":"# `@inquirer/editor`\n\nPrompt that'll open the user preferred editor with default content and allow for a convenient multi-line input controlled through the command line.\n\nThe editor launched is the one [defined by the user's `EDITOR` environment variable](https://dev.to/jonasbn/til-integrate-visual-studio-code-with-shell--cli-2l1l).\n\n# Installation\n\n<table>\n<tr>\n  <th>npm</th>\n  <th>yarn</th>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/prompts\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/prompts\n```\n\n</td>\n</tr>\n<tr>\n<td colSpan=\"2\" align=\"center\">Or</td>\n</tr>\n<tr>\n<td>\n\n```sh\nnpm install @inquirer/editor\n```\n\n</td>\n<td>\n\n```sh\nyarn add @inquirer/editor\n```\n\n</td>\n</tr>\n</table>\n\n# Usage\n\n```js\nimport { editor } from '@inquirer/prompts';\n// Or\n// import editor from '@inquirer/editor';\n\nconst answer = await editor({\n  message: 'Enter a description',\n});\n```\n\n## Options\n\n| Property         | Type                                                                           | Required               | Description                                                                                                                                                                                                                            |\n| ---------------- | ------------------------------------------------------------------------------ | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| message          | `string`                                                                       | yes                    | The question to ask                                                                                                                                                                                                                    |\n| default          | `string`                                                                       | no                     | Default value which will automatically be present in the editor                                                                                                                                                                        |\n| validate         | `string => boolean \\| string \\| Promise<boolean \\| string>`                    | no                     | On submit, validate the content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash.                                  |\n| postfix          | `string`                                                                       | no (default to `.txt`) | The postfix of the file being edited. Adding this will add color highlighting to the file content in most editors.                                                                                                                     |\n| file             | [`IFileOptions`](https://github.com/mrkmg/node-external-editor#config-options) | no                     | Exposes the [`external-editor` package options](https://github.com/mrkmg/node-external-editor#config-options) to configure the temporary file.                                                                                         |\n| waitForUserInput | `boolean`                                                                      | no (default to `true`) | Open the editor automatically without waiting for the user to press enter. Note that this mean the user will not see the question! So make sure you have a default value that provide guidance if it's unclear what input is expected. |\n| theme            | [See Theming](#Theming)                                                        | no                     | Customize look of the prompt.                                                                                                                                                                                                          |\n\n## Theming\n\nYou can theme a prompt by passing a `theme` object option. The theme object only need to includes the keys you wish to modify, we'll fallback on the defaults for the rest.\n\n```ts\ntype Theme = {\n  prefix: string | { idle: string; done: string };\n  spinner: {\n    interval: number;\n    frames: string[];\n  };\n  style: {\n    message: (text: string, status: 'idle' | 'done' | 'loading') => string;\n    error: (text: string) => string;\n    help: (text: string) => string;\n    key: (text: string) => string;\n  };\n  validationFailureMode: 'keep' | 'clear';\n};\n```\n\n`validationFailureMode` defines the behavior of the prompt when the value submitted is invalid. By default, we'll keep the value allowing the user to edit it. When the theme option is set to `clear`, we'll remove and reset to the default value or empty string.\n\n# License\n\nCopyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>\nLicensed under the MIT license.\n","publish_time":1762983668186,"_cnpm_publish_time":1762983668186,"dist-tags":{"latest":"5.4.0"}}