Socket
Socket
Sign inDemoInstall

enquirer-prompt-editor

Package Overview
Dependencies
10
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    enquirer-prompt-editor

Use your text editor as prompt input.


Version published
Maintainers
1
Install size
822 kB
Created

Readme

Source

enquirer-prompt-editor

Prompt for enquirer that opens your preferred text editor ($VISUAL or $EDITOR) and waits for you to save your input during a prompt.

Install

$ yarn add enquirer-prompt-editor

Usage

const Enquirer = require('enquirer');
const enquirer = new Enquirer();

enquirer.register('editor', require('enquirer-prompt-editor'));
enquirer
  .prompt({
    type: 'editor',
    name: 'bio',
    message: 'Please write a short bio of at least 3 lines.',
    extension: 'md',
    validate: text => {
      if (text.split('\n').length < 2) {
        return 'Must be at least 3 lines.';
      }
      return true;
    },
  })
  .then(answers => console.log(answers))
  .catch(err => console.log(err));

Keywords

FAQs

Last updated on 05 Feb 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc