scoobster17 / joose-utils

A lightweight set of utility functions, from the joose component library
0 stars 0 forks source link

Joose Utilities Component

A collection of lightweight, minimal utility helper functions. This component belongs to the Joose component library, but can be used completely independently.

Please see joose for the whole component library.

Installation

To install this component independently using npm

npm install joose-utils

Usage

ES2015+

As of version 2, Joose Utils methods can be imported either individually or collectively:

import utils from '/path/to/node_modules/joose-utils/src/joose-utils';

import { hasClass, addClass } from '/path/to/node_modules/joose-utils/src/joose-utils';

ES5

Simply add the JavaScript onto your page either using a script tag or concatenating/bundling with your own JavaScript:

<script type="text/javascript" src="https://github.com/scoobster17/joose-utils/raw/master/path/to/node_modules/joose-utils/dist/joose-utils-es5.js"></script>

You are then good to go using the joose.utils object available in the global namespace:

joose.utils.hasClass(elem, class);
joose.utils.toggleClass(elem, class);

Methods available