monadojs v0.3.2
MonadoJs
This library allow developper to do some common operations on arrays and objects (filtering, mapping, reducing and sorting).
The idea came when i've wanted to do sum on nested properties of object, and having to declare intermediate variables and calling popular libraries helper functions to do what i wanted. Also i wanted to have the ability to use the functions from the library with common js functions (like filter, reducer, map...) without the need to always use the pipe
functions like in other libraries.
Getting started
To install just run
# npm
npm install monadojs
# yarn
yarn add monadojs
API
Filters
- empty
- endsWith
- eq
- gt
- gte
- includes
- lt
- lte
- match
- neq
- nil
- ofType
- startsWith
- unique
Logical Operators
Logical operators are function that can be used in combination with filter
operator.
- and
- nand
- nor
- not
- or
- xor
Mapper
- capitalize
- ceil
- divide
- floor
- lower
- match-with
- minus
- modulo
- plus
- pow
- prop
- range
- replace
- round
- substring
- times
- transform
- upper
Operators
Operators are functions that can be applyed on both object or array.
- applySpec
- combine
- concat
- encloseIn
- entries
- every
- filter
- find
- identity
- iif
- indexOf
- keys
- length
- map
- merge
- none
- pipe
- reduce
- reverse
- shuffle
- some
- sort
- tap
- values
- walk
Projections
Projections are a combination of operator and mapper at the same time. It can handle arrays or object at the same time and produce a value.
- exclude
- pick
Reducers
Reducers are function that produce a single result by iterating over the passed array.
- avg
- chunk
- first
- flatten
- group
- head
- join
- last
- max
- min
- nth
- sample
- slice
- sum
- tail
- zip
Sorters
- asFirst
- asLast
- asc
- desc
26 days ago
1 month ago
1 month ago
2 months ago
3 months ago
3 months ago
9 months ago
12 months ago
11 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago