Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/grrr-amsterdam/grrr-utils
JavaScript utility library embracing functional programming paradigms.
https://github.com/grrr-amsterdam/grrr-utils
dom functional javascript utilities
Last synced: about 2 months ago
JSON representation
JavaScript utility library embracing functional programming paradigms.
- Host: GitHub
- URL: https://github.com/grrr-amsterdam/grrr-utils
- Owner: grrr-amsterdam
- License: mit
- Created: 2018-10-24T08:11:42.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-05T10:32:19.000Z (about 2 years ago)
- Last Synced: 2024-10-13T19:47:57.256Z (3 months ago)
- Topics: dom, functional, javascript, utilities
- Language: JavaScript
- Homepage:
- Size: 430 KB
- Stars: 14
- Watchers: 5
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Utils
[![CI](https://github.com/grrr-amsterdam/grrr-utils/actions/workflows/ci.yml/badge.svg)](https://github.com/grrr-amsterdam/grrr-utils/actions/workflows/ci.yml)
### JavaScript utility library
- No dependencies
- Includes functional and DOM utility functions
- Lightweight and untranspiled### Developed with ❤️ by [GRRR](https://grrr.nl)
- GRRR is a [B Corp](https://grrr.nl/en/b-corp/)
- GRRR has a [tech blog](https://grrr.tech/)
- GRRR is [hiring](https://grrr.nl/en/jobs/)
- [@GRRRTech](https://twitter.com/grrrtech) tweets## Installation
```sh
$ npm install @grrr/utils
```Note: depending on your setup [additional configuration might be needed](https://github.com/grrr-amsterdam/grrr-utils/wiki/Usage-with-build-tools), since this package is published with untranspiled JavaScript.
## Usage
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';
```## Documentation
View the [documentation](https://github.com/grrr-amsterdam/grrr-utils/tree/master/docs) for all functions and examples of their usage.
### Objects & Arrays
- [deepCopy](docs/README.md#deepCopy)
- [head](docs/README.md#head)
- [last](docs/README.md#last)
- [map](docs/README.md#map)
- [not](docs/README.md#not)
- [omit](docs/README.md#omit)
- [pick](docs/README.md#pick)
- [prop](docs/README.md#prop)
- [reverse](docs/README.md#reverse)
- [sample](docs/README.md#sample)
- [tail](docs/README.md#tail)
- [take](docs/README.md#take)
- [takeLast](docs/README.md#takeLast)### Functional
- [compose](docs/README.md#compose)
- [curry](docs/README.md#curry)
- [debounce](docs/README.md#debounce)
- [memoize](docs/README.md#memoize)
- [tap](docs/README.md#tap)
- [throttle](docs/README.md#throttle)### DOM & Browser
- [closest](docs/README.md#closest)
- [escapeHtml](docs/README.md#escapeHtml)
- [htmlToElement](docs/README.md#htmlToElement)
- [preventDefault](docs/README.md#preventDefault)
- [preventingDefault](docs/README.md#preventingDefault)
- [trapFocus](docs/README.md#trapFocus)
- [triggerEvent](docs/README.md#triggerEvent)
- [unescapeHtml](docs/README.md#unescapeHtml)### Miscellaneous
- [defined](docs/README.md#defined)
- [parseJson](docs/README.md#parseJson)
- [uuid](docs/README.md#uuid)