new TerminalAdapter(optionsopt)
TerminalAdapter
is the default implementation of
Adapter
, an abstraction layer that defines the
I/O interactions.
It provides a CLI interaction
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | <optional> |
Properties
|
Methods
-
diff(actual, expected, changes)
-
Shows a color-based diff of two strings
Parameters:
Name Type Description actual
string expected
string changes
Array returned by diff.
-
prompt(questions, answersopt, callbackopt)
-
Prompt a user for one or more questions and pass the answer(s) to the provided callback.
It shares its interface with
Base.prompt
(Defined inside the constructor to keep interfaces separated between instances)
Parameters:
Name Type Attributes Description questions
Object | Array.<Object> answers
Object <optional> Answers to be passed to inquirer
callback
function <optional> callback