consonant

0.0.2 • Public • Published

Consonant npm version

Tiny library for working with consonants.

Install

$ npm install consonant

Usage

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

API

.consonants

Returns an array with a list of consonants.

.y(boolean)

If whether y should be included as a consonant.

.isConsonant(string)

If string is a single character, returns whether the string is a consonant. If string is longer than a single character, calls .includesConsonant.

.includesConsonant(string)

Returns whether the string includes consonants.

.startsWithConsonant(string)

Returns whether the string starts with a consonant.

.endsWithConsonant(string)

Returns whether the string ends with a consonant.

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i consonant

    Weekly Downloads

    5

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    4.06 kB

    Total Files

    4

    Last publish

    Collaborators

    • paco