How to use the enquirer.Editable function in enquirer

To help you get started, we’ve selected a few enquirer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github enquirer / enquirer / examples / editable / choices-validate.js View on Github external
'use strict';

const colors = require('ansi-colors');
const { Editable } = require('enquirer');

const prompt = new Editable({
  name: 'user',
  message: 'Please provide the following information:',
  promptLine: false,
  align: false,
  choices: [
    {
      name: 'author',
      role: 'heading',
      message: colors.underline.bold('Author information'),
      async indicator() {
        return prompt.style(await prompt.prefix());
      },
      choices: [
        {
          name: 'firstname',
          message: 'First Name',
github enquirer / enquirer / examples / editable / prompt.js View on Github external
'use strict';

const { Editable } = require('enquirer');

const prompt = new Editable({
  name: 'user',
  message: 'Please provide the following information:',
  choices: [
    {
      name: 'firstname',
      message: 'First Name',
      initial: 'Jon',
      editable: true
    },
    {
      name: 'lastname',
      message: 'Last Name',
      initial: 'Schlinkert',
      editable: true
    },
    {
github enquirer / enquirer / examples / editable / prompt-add-choice.js View on Github external
'use strict';

const { Editable } = require('enquirer');

const prompt = new Editable({
  name: 'user',
  message: 'Please provide the following information:',
  choices: [
    {
      name: 'firstname',
      message: 'First Name',
      initial: 'Jon',
      editable: true
    },
    {
      name: 'lastname',
      message: 'Last Name',
      initial: 'Schlinkert',
      editable: true
    }
  ]