Table of contents
Project goal
This project aimed to dive deep into functional programming, better understand unit testing, and get more closely to problem-solving using JavaScript. To be more precise, when I said dive deep into functional programming, I'm talking about the Functors, Monads, Predicate combinators, Lens, etc. Along with the functional programming, I wanted to get more familiar with JavaScript API.
During the project development, I learned how to write documentation. As you can see, the documentation looks pretty good. I used ESDoc, which simplifies the documentation writing process a lot.
The documentation: https://obaranovskyi.github.io/js-helpers/
and here is the repo: https://github.com/obaranovskyi/js-helpers
Usage
I you might already guess, this is a JavaScript utility library that consists of multiple modules, and every module has a whole list of utility functions.
The library includes the following modules:
- Array,
- Context,
- SafeTupleBuilder,
- Tuple,
- Fantasy-Land,
- Function-Combinators,
- Function,
- Lens,
- Math,
- Object,
- Predicate-Combinator,
- Predicate,
- String,
- Type
The list of functions is pretty huge. Along with the general functions available in most JavaScript libraries, the current library includes implementations of the Fantasy Land Specification, an Algebraic JavaScript Specification. It also has Lens, Predicate-Combinator and Predicate helper functions. There is an ability to generate documentation using ESDoc, as every function is well-documented and includes examples. What's more, every function has a few tests. For library testing, I've used a Mocha and Chai. Here is the github repository link.
Summary
In case you find something you want to copy or use in your project, just clone and copy everything you need. It is free to use without any limits. Please consider that it's better to validate the code you'll reuse, as I wrote that library a long time ago. So everything is at your risk. In any case, I hope you will find something for yourself.