1.0.4 • Published 5 years ago

readablejs v1.0.4

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

readablejs

A monad wrapper to extract readable strings from your code's logic.

Examples:

const value = {innerValue: true};
const not = b => !b;

r(value)`My value`
  .s("innerValue")
  .map(not)
  .isFalse()
  .print(); // returns "My value's innerValue mapped by not is false"

You can also use the "r" version to indent the readable part nicely:

const value = {firstname: "John", lastname: "Doe"};

r(value)                `John Doe`
  .sr("lastname")       `last name`
  .mapr(toUpperCase)    `to upper case`
  .isEqualTor("sdfsd")  `random keyboad inputs`
  .appendr()            `:)`
  .print(); // returns "John Doe's last name mapped by to upper case is not equal to random keyboard inputs :)"

Installation :

npm install readablejs

or with yarn:

yarn add readablejs

Then import r:

import r from "readablejs";
1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago