# dom-maker

> A library for create element by VanillaJs easily

Latest version **0.0.8** (published 2022-01-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install dom-maker
pnpm add dom-maker
yarn add dom-maker
bun add dom-maker
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2022-01-10 |
| First published | 2021-12-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 1 |
| Unpacked size | 252.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Fog3211 |
| Maintainers | fog3211 |
| Keywords | element, dom, VanillaJs, dom-manipulation, vanilla-js, jquery |

## Links

- npm: https://www.npmjs.com/package/dom-maker
- npm.io page: https://npm.io/package/dom-maker

## Dependencies (1)

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

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.0.8 (latest) — 2022-01-10
- 0.0.7 — 2022-01-10
- 0.0.6 — 2021-12-31
- 0.0.5 — 2021-12-30
- 0.0.4 — 2021-12-27

## README

# dom-maker

A library for create element by VanillaJs easily

## install

```bash
npm install dom-maker
# 或
yarn add dom-maker
```

## useage

```js
import $ from 'dom-maker';

const dom = $('div')
  .setAttr('data-type', 'img-box')
  .addChildren([
    $('div')
      .addClass('left-area')
      .addChildren([
        $('img')
          .addClass('img cover')
          .setAttr('draggable', false)
          .setAttr('src', 'https://source.unsplash.com/8xznAGy4HcY/800x400'),
      ]),
    $('div')
      .addClass('right-area')
      .addChildren([
        $('div').addClass('title').setText('title'),
        $('div').addClass('href').setText('href'),
      ]),
  ])
  .getElm();

// equal to

// <div data-type="img-box">
//   <div class="left-area">
//     <img src="https://source.unsplash.com/8xznAGy4HcY/" draggable="flase" class="img cover">
//   </div>
//   <div class="left-area">
//     <div class="title">title</div>
//     <div class="href">href</div>
//   </div>
// </div>

document.body.append(dom);
```

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