0.0.3 • Published 6 years ago
vowel v0.0.3
Vowel
Tiny library for working with vowels.
Install
$ npm install vowel
Usage
const vowel = require('vowel');
const { vowels } = vowel;
//=> ['a', 'e', 'i', 'o', 'u']
const { isVowel } = vowel;
isVowel('o');
//=> true
const { includesVowel } = vowel;
includesVowel('rhythms');
//=> false
const { startsWithVowel } = vowel;
startsWithVowel('xylophone');
//=> false
const { endsWithVowel } = vowel;
endsWithVowel('persiflage');
//=> true
API
.vowels
Returns an array
with a list of vowels.
.y(boolean
)
If whether y
should be included as a vowel.
.isVowel(string
)
If string is a single character, returns whether the string is a vowel. If string is longer than a single character, calls .includesVowel
.
.includesVowel(string
)
Returns whether the string includes vowels.
.startsWithVowel(string
)
Returns whether the string starts with a vowel.
.endsWithVowel(string
)
Returns whether the string ends with a vowel.