casette
Casette is a tiny modular converter library. It's ridiculously simple, yet effective.
Installation
npm i casette
Example
const casette = // Built-in convertersvar inch = 2console console // External convertersvar some = // Internal convertersvar res =
Usage
You can use built-in, external or internal converters, that are simple, exported functions
. Take a look at the built-in ones in the converters
directory.
If you have an idea for a converter build it and PR, please. If required, write its test in the converters/converters.test.js
. Tests are cool!
API
casette(value, converter)
Takes the value
and the converter
arguments. value
can be anything, converter
must be function. Returns anything.