# @huangjs888/lightdom

> Light dom operate

Latest version **2.1.5** (published 2023-10-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @huangjs888/lightdom
pnpm add @huangjs888/lightdom
yarn add @huangjs888/lightdom
bun add @huangjs888/lightdom
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.5 |
| Published | 2023-10-13 |
| First published | 2023-10-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 160.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Huangjs |
| Maintainers | huangjs888 |
| Keywords | huangjs, huangjs888, lightdom, document, createElement |

## Links

- npm: https://www.npmjs.com/package/@huangjs888/lightdom
- Repository: https://github.com/huangjs888/lightdom
- Homepage: https://github.com/huangjs888/lightdom#readme
- Issues: https://github.com/huangjs888/lightdom/issues
- npm.io page: https://npm.io/package/@huangjs888/lightdom

## Dependencies (1)

- [@babel/runtime-corejs3](https://npm.io/package/@babel/runtime-corejs3.md) ^7.22.10

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 2.1.5 (latest) — 2023-10-13
- 2.1.4 — 2023-10-13
- 2.1.3 — 2023-10-10
- 2.1.2 — 2023-10-08
- 2.1.1 — 2023-10-08

## README

<!--
 * @Author: Huangjs
 * @Date: 2021-05-10 15:55:29
 * @LastEditors: Huangjs
 * @LastEditTime: 2023-10-09 15:39:16
 * @Description: ******
-->

## lightdom

一些dom操作

### 安装使用

```sh

npm install @huangjs888/lightdom --save

```

### 使用方法

```js

import { createElement, setStyle, addClass, hasClass, removeClass } from '@huangjs888/lightdom';

const dom = createElement(
  {
    className: ['test', 'test2'],
    style: { width: 100, marginTop: 20 },
  },
  createElement('span', { style: { color: 'red' }, dataName: 'span element' }, 'Hello World'),
  document.body,
);
setStyle(addClass(removeClass(dom, 'test2'), 'test3'), { height: 100, marginLeft: 20 });
console.log(hasClass(dom, 'test2'));
console.log(hasClass(dom, 'test3'));


```

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