text-stats-lite
v1.0.0
Published
Small, dependency-free text statistics for Node.js
Downloads
51
Maintainers
Readme
text-stats-lite
Small, dependency-free text statistics for Node.js.
Install
npm install text-stats-liteUsage
import textStats from 'text-stats-lite';
const stats = textStats('Hello world.\nThis is a test!');
// {
// characterCount: 28,
// characterCountNoSpaces: 23,
// wordCount: 6,
// sentenceCount: 2,
// lineCount: 2,
// readingTimeMinutes: 0.03,
// readingTimeSeconds: 2
// }textStats(text, { wordsPerMinute }) accepts an optional reading speed; the default is 200 words per minute. Character counts use JavaScript string length, word matching supports Unicode letters and numbers, and an empty string has zero lines.
Development
npm test
npm run pack:checkLicense
MIT
