Text Analyzer is a Node.js application that analyzes text files and provides various statistics such as character count, word count, sentence count, paragraph count, and the longest words in paragraphs.
-
Clone the repository:
git clone https://github.com/your-username/text-analyzer.git
-
Navigate to the project directory:
cd text-analyzer
- Install dependencies:
npm install
-
Place the text files you want to analyze in the input directory.
-
Run the application:
npm start
- Access the API endpoints to retrieve analysis results:
Word count: GET /api/text/word-count Character count: GET /api/text/character-count Sentence count: GET /api/text/sentence-count Paragraph count: GET /api/text/paragraph-count Longest words in paragraphs: GET /api/text/longest-words-in-paragraphs
Run unit tests:
npm test
Run tests with open handle detection:
npm test -- --detectOpenHandles
Project Structure src/: Contains the application source code. input/: Directory for input text files to be analyzed. tests/: Contains unit and integration tests.
Express.js: For building the RESTful API. Jest: Testing framework. Supertest: HTTP assertions for integration testing. Babel: For transpiling ES6 code.
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.