A utility library for core linguistic breakdown: vowels, consonants, words, and sentences.
Tip
See also:
- @lunarisapp/stats for text statistics (e.g. word count, sentence count, etc.).
- @lunarisapp/readability for text readability scores (e.g. Flesch Reading Ease).
- Browser & Node.js support
- Multi-language support
- TypeScript support
npm install @lunarisapp/languageimport { type Language, vowels, consonants, removePunctuation, getWords, getSentences } from '@lunarisapp/language';
const lang: Language = 'en_US';
const enVowels = vowels[lang];
const enConsonants = consonants[lang];
const text = 'Hello, world!';
const words = getWords(text);
const sentences = getSentences(text);
const textWithoutPunctuation = removePunctuation(text);