# build-element

> Create html elements

Latest version **1.0.0** (published 2017-08-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install build-element
pnpm add build-element
yarn add build-element
bun add build-element
```

## 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.0 |
| Published | 2017-08-19 |
| First published | 2017-08-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Tobias Herber |
| Maintainers | tobihrbr |
| Keywords | html, element, elements, components, build, create, dom, string |

## Links

- npm: https://www.npmjs.com/package/build-element
- Repository: https://github.com/tobihrbr/build-element
- Homepage: https://github.com/tobihrbr/build-element#readme
- Issues: https://github.com/tobihrbr/build-element/issues
- npm.io page: https://npm.io/package/build-element

## Dependencies (3)

- [html-tags](https://npm.io/package/html-tags.md) ^2.0.0
- [style-string](https://npm.io/package/style-string.md) ^1.0.1
- [attribute-string](https://npm.io/package/attribute-string.md) ^1.0.1

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2017-08-19

## README

# build-element [![Build Status](https://travis-ci.org/tobihrbr/build-element.svg?branch=master)](https://travis-ci.org/tobihrbr/build-element)

> Create html elements

## Install

```
$ npm install --save build-element
```

## Usage

```js
const buildElement = require('build-element');

buildElement('div', 'children', { attributes: { class: 'test' }, style: { color: 'blue' } });
//=> '<div class="test" style="color: blue>children</div>'

buildElement('img', { attributes: { src: 'https://source.unsplash.com/random' } });
//=> '<img src="https://source.unsplash.com/random" />'
```

## API

### buildElement(element, [children, options])

#### element

Type: `string`

The type of element eg. `div`, `p`, `img`, ...

#### children

Type: `string`, `array`

The element's children.

#### options

Type: `object``

##### attributes

Type: `object`

Attributes for the element eg. `class`, `src`, ...

##### style

Type: `object`

Inline styles

## License

MIT © [Tobias Herber](https://tobihrbr.com)

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