count-vowels

returns the number of vowels from a text (string).

Usage no npm install needed!

<script type="module">
  import countVowels from 'https://cdn.skypack.dev/count-vowels';
</script>

README

count-vowels

This module returns the number of vowels from a text (string).

Installation

  > npm install count-vowels

Usage

import countVowels from 'count-vowels' // or  const countVowels = require('count-vowels')

console.log(countVowels('Github has it.')); // ==> 4
console.log(countVowels('Lorem ipsum dolor sit amet, consectetur adipiscing elit.')); // ==> 19

Raison d'être

Trying to recollect the vowels of the alphabet and implementing a count function is annoying. This will hopefully help you focus on more important stuff.

Super Light (5 sloc). No dependencies.

License

© Mohamed Hayibor