AnyTextAnalyzer is a simple npm package for analyzing text. It provides functionality to count words, characters, sentences, and paragraphs in a given text string.
You can install the package via npm:
npm install anytextanalyzer
const AnyTextAnalyzer = require('anytextanalyzer');
const text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.";
const analyzer = new AnyTextAnalyzer(text);
const analysisResult = analyzer.analyze();
console.log(analysisResult);
The analyze()
method returns an object containing the following properties:
-
wordCount
: Number of words in the text. -
charCount
: Number of characters in the text. -
sentenceCount
: Number of sentences in the text. -
paragraphCount
: Number of paragraphs in the text.
This project is licensed under the MIT License - see the LICENSE file for details.