rawjs is a shortcut utility library to speed up data transformation, dates manipulation, formatting and function composition.
It is a simpler version of lodash and moment.
Installation:
- in browser:
<script src="https://vbrajon.github.io/rawjs/raw.js"></script>
- in node:
npm i git+https://git@github.com/vbrajon/rawjs.git
thenimport 'rawjs'
orrequire('rawjs')
- in cli:
npm i -g git+https://git@github.com/vbrajon/rawjs.git
thenraw
It brings:
- functions:
Object.map
,Array.group
,Function.throttle
,Date.plus
and 50 more - shortcuts:
[].find(/Jo/)
equals[].find(v => /Jo/.test(v))
- chaining:
[].map('name.length').filter(v => v > 5).sum()
- immutability: including
[].sort()
and[].reverse()
It is:
- easy to learn: ~50 functions / no dependencies / ~250 lines codebase
- lightweight: ~4k gzipped
- extensible:
Array.first = arr => arr[0]
+Object.extend(true)
=[].first()