# tag

> Library for creating DOM elements

Latest version **0.4.17** (published 2020-12-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install tag
pnpm add tag
yarn add tag
bun add tag
```

## 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.4.17 |
| Published | 2020-12-02 |
| First published | 2016-03-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Oleksandr Tarasiuk |
| Maintainers | otarasiuk |
| Keywords | dom, html, tags |

## Links

- npm: https://www.npmjs.com/package/tag
- Repository: https://github.com/a-tarasyuk/tag
- Homepage: https://github.com/a-tarasyuk/tag#readme
- Issues: https://github.com/a-tarasyuk/tag/issues
- npm.io page: https://npm.io/package/tag

## 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

- 0.4.17 (latest) — 2020-12-02
- 0.4.16 — 2020-04-17
- 0.4.15 — 2020-02-02
- 0.4.14 — 2019-12-09
- 0.4.13 — 2019-10-02
- 0.4.12 — 2019-07-17
- 0.4.11 — 2019-06-11
- 0.4.10 — 2019-05-19
- 0.4.9 — 2019-04-22
- 0.4.8 — 2018-12-26
- 0.4.7 — 2018-11-29
- 0.4.6 — 2018-11-29
- 0.4.5 — 2018-10-22
- 0.4.4 — 2018-10-20
- 0.4.3 — 2018-10-20
- … 4 more at https://npm.io/package/tag/versions

## README

# tag

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/a-tarasyuk/tag/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/tag.svg?style=flat-square)](https://www.npmjs.com/package/tag) [![npm downloads](https://img.shields.io/npm/dm/tag.svg?style=flat-square)](https://www.npmjs.com/package/tag) [![Build Status](https://img.shields.io/travis/a-tarasyuk/tag/master.svg?style=flat-square)](https://travis-ci.org/a-tarasyuk/tag) ![npm bundle size (minified)](https://img.shields.io/bundlephobia/min/tag.svg?style=flat-square) ![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/tag.svg?style=flat-square)

## Installation

```shell
npm install tag --save
```

or

```html
<script src="tag.iife.js"></script>
```

## `tag(name, *attributes, children)`

- **Parameters**
  - **name**: String
  - **attributes**: Object (optional)
  - **children**: Array | String
- **Returns** - HTMLElement

## Example

```javascript
import tag from 'tag';

tag('div', { id: 'content' }, 'content');

tag('div', { id: 'content' }, [tag('span', 'content')]);

tag('div', [tag('span', '<strong>content</strong>')]);

tag('hr');

tag('label', [tag('input', { type: 'text' }), 'Label text']);
```

## License and Copyright

This software is released under the terms of the [MIT license](https://github.com/a-tarasyuk/tag/blob/master/LICENSE).

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