nelsonkuang / min-dom

A minimal DOM utility toolbelt. Library friendly and based on utilities provided by component.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

min-dom

CI

A minimal dom utility toolbelt. Library friendly and based on utilities provided by component.

Footprint

This library is tiny (< 2Kb in size) and still exposes all fundamental utilities:

$ npm run distro
$ gzip dist/min-dom.min.js
$ du -b dist/*.gz
1675    min-dom.min.js.gz

Features

The library exposes the following tiny dom helpers:

  • assignStyle - add inline styles to a node
  • attr - get and set node attributes
  • classes - class name helper
  • clear - remove children from a node
  • closest - get the closest parent by selector;
  • delegate - event deletation support; delegate-events
  • domify - html to elements; domify
  • event - event binding; component-event
  • matches - selector match check
  • query - native selector query support
  • remove - detach a node from its parent

Related

  • min-dash - minimal lodash inspired utility toolbelt
  • tiny-svg - tiny SVG utility toolbelt

License

MIT

About

A minimal DOM utility toolbelt. Library friendly and based on utilities provided by component.

License:MIT License


Languages

Language:JavaScript 96.5%Language:TypeScript 3.5%