# @bobz/dom-js

> Collection of small frequently used Js functions for DOM elements manipulation across projects. Nothing fancy, just simple stuff. Simply for writing less code.

Latest version **1.0.1** (published 2022-04-02) · GPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install @bobz/dom-js
pnpm add @bobz/dom-js
yarn add @bobz/dom-js
bun add @bobz/dom-js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2022-04-02 |
| First published | 2022-04-02 |
| Weekly downloads | 0 |
| License | GPL-3.0-or-later |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Vlado Bosnjak |
| Maintainers | bobz |
| Keywords | DOM manipulation, Javascript |

## Links

- npm: https://www.npmjs.com/package/@bobz/dom-js
- Repository: https://github.com/code-soup/dom-js
- Issues: https://github.com/code-soup/dom-js/issues
- npm.io page: https://npm.io/package/@bobz/dom-js

## Recent versions

- 1.0.1 (latest) — 2022-04-02

## README

# DOM Js
Collection of small frequently used Js functions for DOM elements manipulation across projects. Nothing fancy, just simple stuff. Simply for writing less code.

## Issues
Please use [Github issues](https://github.com/code-soup/dom-js/issues) to submit any bugs you may find.


## Documentation

    @import dom from '@bobz/dom-js';
   
Wrapper of document.querySelector();

    dom.get('.selector'); 
    dom.getAll('.selector'); // instead of document.querySelectorAll();
    
Un/Set class on node

    dom.addClass(node, className); 
    dom.removeClass(node, className);
    
Un/Set class on node via selector

    dom.setClass(selector, className);
    dom.unsetClass(selector, className);
 
Get Bounding rect

    dom.getRect(selector)
    
Get dataset attribute

    dom.getData(node, attr);


#### License
This project is licensed under the [GPL license](http://www.gnu.org/licenses/gpl-3.0.txt).

---
_Source: https://npm.io/package/@bobz/dom-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
