JavaScript utility functions, by GRRR.
npm install @grrr/utils
- No dependencies
- Includes functional and DOM utility functions
- Lightweight and untranspiled
- GRRR is a B Corp
- GRRR has a tech blog
- GRRR is hiring
- @GRRRTech tweets
``sh`
$ npm install @grrr/utils
Note: depending on your setup additional configuration might be needed, since this package is published with untranspiled JavaScript.
Import a function and invoke it:
`js
import { closest } from '@grrr/utils';
const findParentFoo = closest(el => el.hasAttribute(data-foo));`
Functions can also be imported from the function file itself:
`js``
import closest from '@grrr/utils/functions/closest.mjs';
View the documentation for all functions and examples of their usage.
- deepCopy
- head
- last
- map
- not
- omit
- pick
- prop
- reverse
- sample
- tail
- take
- takeLast
- compose
- curry
- debounce
- memoize
- tap
- throttle
- closest
- escapeHtml
- htmlToElement
- preventDefault
- preventingDefault
- trapFocus
- triggerEvent
- unescapeHtml