A tiny, tested, type-safe vowel processing toolkit for modern JavaScript. Supports ES6 style imports, Node.js 18+ with named exports. Fully unit tested with Jest.
π¨ Vowelz 3.x.x is a complete rewrite. If you were using a previous version (2.0.0 or older), you must migrate your imports and usage. This version introduces breaking changes:
- Switched from class-based API β functional API
- Switched from CommonJS β ES Modules (ESM)
- Node.js version requirement is now 18+
- Flat named exports instead of instance methods
npm install vowelz- Tiny and dependency-free
- Fully unit tested with Jest
- Type-safe (TypeScript support out of the box)
- Focused vowel manipulation utilities
countAllVowelsgetTotalCountgetCountOfUniqueVowelsextractAllVowelsFromStringgetPositionsOfVowelssetAllVowelsToUpperCasesetAllVowelsToLowerCasereplaceVowelsWithCharacterremoveAllVowelsFromStringencryptAllVowels
- π Count All Vowels
/* Counts every vowel occurrence in a string. */
import { countAllVowels } from 'vowelz';
const result = countAllVowels('hello');
console.log(result);
/*
Expected Output:
{
input: "hello",
count: {
a: 0,
e: 1,
i: 0,
o: 1,
u: 0
}
}
*/- π Encrypt All Vowels
import { encryptAllVowels } from 'vowelz';
const result = encryptAllVowels('hello');
console.log(result);
/*
Expected Output:
{ input: "hello", encrypted: "h3ll0" }
*/- π Extract All Vowels From String
import { extractAllVowelsFromString } from 'vowelz';
const result = extractAllVowelsFromString('hello');
console.log(result);
/*
Expected Ouput:
{
input: "hello",
extract: ["e", "o"]
}
*/- π Get Count Of Unique Vowels
import { getCountOfUniqueVowels } from 'vowelz';
const result = getCountOfUniqueVowels('beautiful');
console.log(result);
/*
Expected Output:
{ input: "beautiful", unique: 4 }
*/- π Get Position Of Vowels
import { getPositionsOfVowels } from 'vowelz';
const result = getPositionsOfVowels('hello');
console.log(result);
/*
Expected Output:
{
input: "hello",
positions: [1, 4]
}
*/- π Get Total Count
import { getTotalCountOfVowels } from 'vowelz';
const result = getTotalCountOfVowels('hello');
console.log(result);
/*
Expected Output:
{
input: "hello",
total: 2
}
*/- π Remove All Vowels From String
import { removeAllVowelsFromString } from 'vowelz';
const result = removeAllVowelsFromString('hello');
console.log(result);
/*
Expected Output:
{
input: "hello",
removed: "hll"
}
*/- π Replace Vowels With Character
import { replaceVowelsWithCharacter } from 'vowelz';
const result = replaceVowelsWithCharacter('hello', '*');
console.log(result);
/*
Expected Output:
{
input: "hello",
mutated: "h*ll*"
}
*/- π Set All Vowels To Lower Case
import { setAllVowelsToLowerCase } from 'vowelz';
const result = setAllVowelsToLowerCase('HELLO');
console.log(result);
/*
Expected Output:
{
input: "HELLO",
lower: "HeLLo"
}
*/- π Set All Vowels To Upper Case
import { setAllVowelsToUpperCase } from 'vowelz';
const result = setAllVowelsToUpperCase('hello');
console.log(result);
/*
Expected Output:
{
input: "hello",
upper: "hEllO"
}
*/PASS tests/count-all-vowels.test.ts
PASS tests/encrypt-all-vowels.test.ts
PASS tests/extract-all-vowels-from-string.test.ts
PASS tests/get-count-of-unique-vowels.test.ts
PASS tests/get-positions-of-vowels.test.ts
PASS tests/get-total-count.test.ts
PASS tests/remove-all-vowels-from-string.test.ts
PASS tests/replace-vowels-with-character.test.ts
PASS tests/set-all-vowels-to-lower-case.test.ts
PASS tests/set-all-vowels-to-upper-case.test.ts
Test Suites: 10 passed, 10 total
Tests: 50 passed, 50 total
Snapshots: 0 total
--------------------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
--------------------------------|---------|----------|---------|---------|-------------------
All files | 100 | 97.67 | 100 | 100 |
count-all-vowels | 100 | 100 | 100 | 100 |
index.ts | 100 | 100 | 100 | 100 |
encrypt-all-vowels | 100 | 80 | 100 | 100 | 21
index.ts | 100 | 80 | 100 | 100 | 21
extract-all-vowels-from-string | 100 | 100 | 100 | 100 |
index.ts | 100 | 100 | 100 | 100 |
get-count-of-unique-vowels | 100 | 100 | 100 | 100 |
index.ts | 100 | 100 | 100 | 100 |
get-positions-of-vowels | 100 | 100 | 100 | 100 |
index.ts | 100 | 100 | 100 | 100 |
get-total-count | 100 | 100 | 100 | 100 |
index.ts | 100 | 100 | 100 | 100 |
remove-all-vowels-from-string | 100 | 100 | 100 | 100 |
index.ts | 100 | 100 | 100 | 100 |
replace-vowels-with-character | 100 | 100 | 100 | 100 |
index.ts | 100 | 100 | 100 | 100 |
set-all-vowels-to-lower-case | 100 | 100 | 100 | 100 |
index.ts | 100 | 100 | 100 | 100 |
set-all-vowels-to-upper-case | 100 | 100 | 100 | 100 |
index.ts | 100 | 100 | 100 | 100 |
--------------------------------|---------|----------|---------|---------|-------------------
Contributions, suggestions, and improvements are welcome.
Feel free to open issues or pull requests.
- This package is open source and intended to provide reusable utilities for application development. It does not collect, store, transmit, sell, or share user data, and it does not include analytics, tracking, telemetry, cookies, local storage usage, backend services, or project-owned data collection mechanisms.
- For more details, including vulnerability reporting guidance and consumer security recommendations, please see the Security Policy.
Like this project? Support it with a github star, it would mean a lot to me! Cheers and Happy Coding.
