UNPKG

trnct

Version:

Truncate all specified vowels from given word unless it is the first character

50 lines (31 loc) 1.94 kB
# trnct [![build status](https://badgen.net/travis/vladimyr/trnct/master)](https://travis-ci.com/vladimyr/trnct) [![install size](https://badgen.net/packagephobia/install/trnct)](https://packagephobia.now.sh/result?p=trnct) [![npm package version](https://badgen.net/npm/v/trnct)](https://npm.im/trnct) [![github license](https://badgen.net/github/license/vladimyr/trnct)](https://github.com/vladimyr/trnct/blob/master/LICENSE) [![js semistandard style](https://badgen.net/badge/code%20style/semistandard/pink)](https://github.com/Flet/semistandard) > Truncate vowels ~ `e`ℹ️🅾️ [![forthebadge](https://forthebadge.com/images/badges/as-seen-on-tv.svg)](https://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/you-didnt-ask-for-this.svg)](https://forthebadge.com) ## Instalation $ npm install trnct ## Usage ```js const trnct = require('trnct'); trnct('vowels'); //=> 'vwls' ``` ## API <!-- Generated by documentation.js. Update this documentation by updating the source code. --> #### Table of Contents - [trnct](#trnct) - [Parameters](#parameters) - [Examples](#examples) ### trnct Truncate all specified vowels from given word unless it is the first character #### Parameters - `str` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** input - `vowels` **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)> | [String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))** vowels to truncate (optional, default `['e','i','o']`) #### Examples ```javascript trnct('extension'); //=> 'extnsn' trnct('extension', 'ei'); //=> 'extnson' ``` Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** truncated string