Tiny library for working with consonants.
Install
$ npm install consonant
Usage
const consonant = ; const consonants = consonant;//=> ['b', 'c', 'd', 'f', ...] const isConsonant = consonant;;//=> true const includesConsonant = consonant;;//=> true const startsWithConsonant = consonant;;//=> true const endsWithConsonant = consonant;;//=> false
API
.consonants
Returns an array
with a list of consonants.
boolean
)
.y(If whether y
should be included as a consonant.
string
)
.isConsonant(If string is a single character, returns whether the string is a consonant. If string is longer than a single character, calls .includesConsonant
.
string
)
.includesConsonant(Returns whether the string includes consonants.
string
)
.startsWithConsonant(Returns whether the string starts with a consonant.
string
)
.endsWithConsonant(Returns whether the string ends with a consonant.