word-counter-tool-cli
Version:
A simple TypeScript console application to count the length of entered text in characters
21 lines (20 loc) • 556 B
JavaScript
import inquirer from "inquirer";
async function main() {
try {
const countWords = await inquirer.prompt([
{
name: "enterText",
type: "input",
message: "Enter or paste your text:",
},
]);
const words = countWords.enterText;
console.log("Received text:", words);
console.log(`The length of words is ${words.length} characters`);
}
catch (error) {
console.log("An error aoccured:", error);
}
}
main();