🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

cli-qa

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-qa

Command-line Questions & Answers

0.0.0
Source
npm
Version published
Weekly downloads
21
425%
Maintainers
1
Weekly downloads
 
Created
Source

cli-qa

Command-line Questions & Answers. Supports color formatting, lists, yes/no confirmations.

Install

$ npm install cli-qa

Usage

var QA = require('cli-qa')

var questions = [
  { key: "name", title: "Hey! What's your name?" },
  { key: "foods", title: "What are your 3 most favorite foods?", list: 3 },
  { title: "Favorite books?", description: "Type as much as you want!", list: true }, // unlimited list input
  "Thoughts?",
  { title: "That's all?", description: "Yes/No", bool: true }
];

QA(questions, function (answers) {
  console.log(answers)
  // => {
  //      "name": "Azer",
  //      "foods": ["falafel", "babi guling", "kebab"],
  //      "favoriteBooks": ["snow", "white castle"],
  //      "thoughts": "let's go somewhere!",
  //      "thatsAll": true
  //    }
})

Styling

Title and description fields can be styled with style-format interface. Here is an example;

QA([{ title: "{green}Yes{reset}/{red}No{reset}?", bool: true }], function (answers) {
  answers[yesNo]
  // => true or false
})

Keywords

io

FAQs

Package last updated on 27 Sep 2015

Did you know?

Socket

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