const { countCharacters, countWords, getReadingTime } = await npm(
"text-analyzer"
);
const { getSelectedText } = await kit("text");
const selectedText = await getSelectedText();
const characters = countCharacters(selectedText);
const words = countWords(selectedText);
const readingTime = getReadingTime(selectedText);
const readingTimeMinutes = readingTime.minutes;
show(`
<section style="margin:10px">
<p>Characters: ${characters}</p>
<p>Words: ${words}</p>
<p>Reading time: ${readingTimeMinutes} minutes</p>
</section>
`);