rawjs
rawjs copied to clipboard
🔪 Shortcut Utils
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://[email protected]/vbrajon/rawjs.gitthenimport 'rawjs'orrequire('rawjs') - in cli:
npm i -g git+https://[email protected]/vbrajon/rawjs.gitthenraw
It brings:
- functions:
Object.map,Array.group,Function.throttle,Date.plusand 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()