UNPKG

baxterize

Version:

A dumb a library which will expand letters and numbers into spelled out versions and except it own output as an input to reverse the transform.

29 lines (22 loc) 1.2 kB
# baxterize A really pointless Node JS library to expand strings and numbers into expanded "phonetic" equivalents, and accept its own output back. It also read the output aloud for some reason. Its a really, really useless little chunk of code. ## Installation ``` npm install baxterize ``` ## Usage ``` var Baxterize = require('baxterize'); var baxter = new Baxterize(); const pointless = baxter.expand('wellthisispointless'); > 'double-u-eee-ell-ell-tea-aitch-eye-ess-eye-ess-pea-oh-eye-enn-tea-ell-eee-ess-ess' baxter.contract(pointless) > 'wellthisispointless' ``` ### Options | Name | type | Use | |---|---|---| | `speak` | `bool` | Will attempt to read aloud the result of any `contract` or `expand` request | | `write` | `bool` | Will attempt to write out the a `wav` output of any `contract` or `expand` request. This is written out in project root. | | `type` | `string` | This allows for a few different types of translating. Supported types are `alpha`, `phonetic`, `bin` and `hex` (yes, this is rather stupid when it could be accomplished by a single map) | | `map` | `object` | this allows you to specify how the input should be transformed. This is a simple key/value pair |