https://github.com/statikbe/npm-helpers
https://github.com/statikbe/npm-helpers
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/statikbe/npm-helpers
- Owner: statikbe
- License: mit
- Created: 2020-02-10T13:52:23.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-13T13:06:42.000Z (almost 3 years ago)
- Last Synced: 2025-03-15T11:04:36.336Z (over 1 year ago)
- Language: JavaScript
- Size: 117 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @statikbe/helpers
https://www.npmjs.com/package/@statikbe/helpers
## Installation
```
npm install @statikbe/helpers
yarn add @statikbe/helpers
```
## Usage
```
import { toArray } from '@statikbe/helpers';
toArray(document.querySelector('.my-class'));
```
## Methods
| method | description | returns |
| --- | --- | --- |
| `isIterable(obj)` | Checks if `obj` is iterable. | `Boolean` |
| `toArray(obj)` | Converts iterable object to array, if not iterable creates array containing `obj`. | `Array` |
| `toggle(elements [, display])` | Shows or hides target element(s). | - |
| `trigger(elements, eventName)` | Trigger an event on element(s). | - |