@inquirer/editor
Inquirer multiline editor prompt
Last updated 3 years ago by sboudrias .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @inquirer/editor 
SYNC missed versions from official npm registry.

@inquirer/editor

Prompt that'll open the user preferred editor with default content and allow for a convenient multi-line input controlled through the command line.

Installation

npm install @inquirer/editor

yarn add @inquirer/editor

Usage

import editor from '@inquirer/editor';

const answer = await editor({
  message: 'Enter a description',
});

Options

Property Type Required Description
message string yes The question to ask
default string no Default value which will automatically be present in the editor
validate string => boolean \| string \| Promise<string \| boolean> 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.
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.
waitForUseInput 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.
theme See Theming no Customize look of the prompt.

Theming

You 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.

type Theme = {
  prefix: string;
  spinner: {
    interval: number;
    frames: string[];
  };
  style: {
    message: (text: string) => string;
    error: (text: string) => string;
    help: (text: string) => string;
    key: (text: string) => string;
  };
};

License

Copyright (c) 2023 Simon Boudrias (twitter: @vaxilart)
Licensed under the MIT license.

Current Tags

  • 5.4.0                                ...           latest (17 days ago)

129 Versions

  • 5.4.0                                ...           17 days ago
  • 5.3.6                                ...           a month ago
  • 5.3.5                                ...           a month ago
  • 5.3.4                                ...           2 months ago
  • 5.3.3                                ...           3 months ago
  • 5.3.2                                ...           3 months ago
  • 5.3.1                                ...           3 months ago
  • 5.3.0                                ...           3 months ago
  • 5.2.2                                ...           6 months ago
  • 5.2.1                                ...           6 months ago
  • 5.2.0                                ...           6 months ago
  • 5.1.2                                ...           7 months ago
  • 5.1.1                                ...           7 months ago
  • 5.1.0                                ...           8 months ago
  • 5.0.10                                ...           8 months ago
  • 5.0.9                                ...           8 months ago
  • 5.0.8                                ...           9 months ago
  • 5.0.7                                ...           9 months ago
  • 5.0.6                                ...           9 months ago
  • 5.0.5                                ...           9 months ago
  • 5.0.4                                ...           a year ago
  • 5.0.3                                ...           a year ago
  • 5.0.2                                ...           a year ago
  • 5.0.1                                ...           a year ago
  • 5.0.0                                ...           a year ago
  • 4.2.23                                ...           a year ago
  • 4.2.22                                ...           a year ago
  • 4.2.21                                ...           a year ago
  • 4.2.20                                ...           a year ago
  • 4.2.19                                ...           a year ago
  • 4.2.18                                ...           a year ago
  • 4.2.17                                ...           a year ago
  • 4.2.16                                ...           a year ago
  • 4.2.15                                ...           a year ago
  • 4.2.14                                ...           a year ago
  • 4.2.13                                ...           2 years ago
  • 4.2.12                                ...           2 years ago
  • 4.2.11                                ...           2 years ago
  • 4.2.10                                ...           2 years ago
  • 4.2.9                                ...           2 years ago
  • 4.2.8                                ...           2 years ago
  • 4.2.7                                ...           2 years ago
  • 4.2.6                                ...           2 years ago
  • 4.2.5                                ...           2 years ago
  • 4.2.4                                ...           2 years ago
  • 4.2.3                                ...           2 years ago
  • 4.2.2                                ...           2 years ago
  • 4.2.1                                ...           2 years ago
  • 4.2.0                                ...           2 years ago
  • 4.1.0                                ...           2 years ago
  • 4.0.1                                ...           2 years ago
  • 4.0.0                                ...           2 years ago
  • 3.0.1                                ...           2 years ago
  • 3.0.0                                ...           2 years ago
  • 2.2.0                                ...           2 years ago
  • 2.1.22                                ...           2 years ago
  • 2.1.21                                ...           2 years ago
  • 2.1.20                                ...           2 years ago
  • 2.1.19                                ...           2 years ago
  • 2.1.18                                ...           2 years ago
  • 2.1.17                                ...           2 years ago
  • 2.1.16                                ...           2 years ago
  • 2.1.15                                ...           2 years ago
  • 2.1.14                                ...           2 years ago
  • 2.1.13                                ...           2 years ago
  • 2.1.12                                ...           2 years ago
  • 2.1.11                                ...           2 years ago
  • 2.1.10                                ...           2 years ago
  • 2.1.9                                ...           2 years ago
  • 2.1.8                                ...           3 years ago
  • 2.1.7                                ...           3 years ago
  • 2.1.6                                ...           3 years ago
  • 2.1.5                                ...           3 years ago
  • 2.1.4                                ...           3 years ago
  • 2.1.3                                ...           3 years ago
  • 2.1.2                                ...           3 years ago
  • 2.1.1                                ...           3 years ago
  • 2.1.0                                ...           3 years ago
  • 2.0.2                                ...           3 years ago
  • 2.0.1                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 1.2.15                                ...           3 years ago
  • 1.2.14                                ...           3 years ago
  • 1.2.13                                ...           3 years ago
  • 1.2.12                                ...           3 years ago
  • 1.2.11                                ...           3 years ago
  • 1.2.10                                ...           3 years ago
  • 1.2.9                                ...           3 years ago
  • 1.2.8                                ...           3 years ago
  • 1.2.7                                ...           3 years ago
  • 1.2.6                                ...           3 years ago
  • 1.2.5                                ...           3 years ago
  • 1.2.4                                ...           3 years ago
  • 1.2.3                                ...           3 years ago
  • 1.2.2                                ...           3 years ago
  • 1.2.1                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.11                                ...           4 years ago
  • 1.0.10                                ...           4 years ago
  • 1.0.9                                ...           4 years ago
  • 1.0.8                                ...           4 years ago
  • 1.0.7                                ...           4 years ago
  • 1.0.6                                ...           4 years ago
  • 1.0.4                                ...           4 years ago
  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
  • 0.0.21-alpha.0                                ...           4 years ago
  • 0.0.20-alpha.0                                ...           4 years ago
  • 0.0.19-alpha.0                                ...           4 years ago
  • 0.0.17-alpha.0                                ...           4 years ago
  • 0.0.16-alpha.0                                ...           4 years ago
  • 0.0.15-alpha.0                                ...           4 years ago
  • 0.0.14-alpha.0                                ...           4 years ago
  • 0.0.13-alpha.0                                ...           5 years ago
  • 0.0.12-alpha.0                                ...           5 years ago
  • 0.0.11-alpha.0                                ...           5 years ago
  • 0.0.10-alpha.0                                ...           5 years ago
  • 0.0.9-alpha.0                                ...           5 years ago
  • 0.0.8-alpha.0                                ...           6 years ago
  • 0.0.7-alpha.0                                ...           6 years ago
  • 0.0.6-alpha.0                                ...           6 years ago
  • 0.0.5-alpha.0                                ...           6 years ago
  • 0.0.4-alpha.0                                ...           6 years ago
  • 0.0.3-alpha.0                                ...           6 years ago
  • 0.0.2-alpha.0                                ...           7 years ago
Downloads
Total 321
Today 0
This Week 1
This Month 271
Last Day 1
Last Week 129
Last Month 50
Dependencies (4)
Dev Dependencies (0)
None
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE