1.0.0 • Published 2 years ago

inq-asker v1.0.0

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

inq

  • Quickly and easily build interactive menus for cli applications.

help

nbb runner.cljs -h
 Quickly and easily build interactive menus for cli applications.

 Inquier's prompt types: https://github.com/SBoudrias/Inquirer.js/#prompt-types

Usage:

 Ask for a title, and a port:
   inq '[{:name :title} {:type :number, :name :port}]'

 Ask and validate a question, with a message
   inq '[{:type :number, :name :age, :message "How old are you?", :validate (fn [age _answers] (if (pos? age) true "Age must be positive."))}]'


 Ask for name, age, and password
   inq '[{:name :name, :message "What is your name?"} {:type :number, :name :age, :message "How old are you?"} {:type :password, :name :pw, :message "What is your password?"}]'


 Inquier's prompt types: https://github.com/SBoudrias/Inquirer.js/#prompt-types
Usage:

 Ask for a string, a number, and confirm it:
   inq '[{:name :my-string} {:type :number, :name :my-num} {:type :confirm, :name :my-boolean}]'


 Ask and validate a question, with a message
   inq '[{:type :number, :name :age, :message "How old are you?", :validate (fn [age _answers] (if (pos? age) true "Age must be positive."))}]'


 Ask for name, age, and password
   inq '[{:type :input, :name :name, :message "What is your name?"} {:type :number, :name :age, :message "How old are you?"} {:type :password, :name :pw, :message "What is your password?"}]'