essenz
v1.2.3
Published
Essential JS functions for everyday use
Downloads
20
Readme
essenz
The convenience library for JavaScript.
This is a library that contains commonly used functions to work with arrays, object, HTML elements etc. It can be used as a replacement for babel-polyfill
since it's rather big in size. But essenz
doesn't provide real polyfills, just an individual set of functions that can be imported using import { fun } from 'essenz'
.
For now please see index.d.ts
for a list of functions.
Some examples
Add events to all elements with the same class
import {selectByClass, addEvent} from 'essenz'
const clickMeElements = selectByClass('click-me')
addEvent(clickMeElements, 'click', event => console.log('hello'))
Map over objects
import {objectEntries} from 'essenz'
const data = {a: 10, b: 30}
objectEntries(data)
.map(([key, value]) => console.log(key, value))
// > a 10
// > b 30