consonant
Version:
tiny library for working with consonants
67 lines (41 loc) • 1.39 kB
Markdown
Tiny library for working with consonants.
```
$ npm install consonant
```
```js
const consonant = require('consonant');
const { consonants } = consonant;
//=> ['b', 'c', 'd', 'f', ...]
const { isConsonant } = consonant;
isConsonant('x');
//=> true
const { includesConsonant } = consonant;
includesConsonant('rhythms');
//=> true
const { startsWithConsonant } = consonant;
startsWithConsonant('xylophone');
//=> true
const { endsWithConsonant } = consonant;
endsWithConsonant('persiflage');
//=> false
```
Returns an `array` with a list of consonants.
If whether `y` should be included as a consonant.
If string is a single character, returns whether the string is a consonant. If string is longer than a single character, calls `.includesConsonant`.
Returns whether the string includes consonants.
Returns whether the string starts with a consonant.
Returns whether the string ends with a consonant.
<p align="center">
<a href="http://paco.sh"><img src="https://raw.githubusercontent.com/pacocoursey/pacocoursey.github.io/master/footer.png" height="300"></a>
</p>