1.0.0 • Published 3 years ago
cli4u v1.0.0
CLI4U
Some graphical help for command line in Node.js
Installation
npm i cli4u
Usage
// Import
const CLI4U = require("cli4u");
// Initialize
const cli4u = new CLI4U();
API
// Print information
cli4u.info("Hello World");
// Ask a choice question
cli4u.ask("Question", {
type: cli4u.values.type.CHOICE,
answers: [
"Your",
"Answers",
"Here"
]
// Callback with a number parameter
}, callback);
// Ask a text question
cli4u.ask("Question", {
type: cli4u.values.type.TEXT,
// Only allowed characters | Any string for custom characters set | Empty for everything
allowedCharacters:
cli4u.values.text.ALPHABET_LOWER +
cli4u.values.text.NUMBER
// Callback with a string parameter
}, callback);
// Print error
cli4u.error('Your error');
// Stop the library
cli4u.exit();
1.0.0
3 years ago