<commit_before># Element Wrapper

[![Build Status](https://travis-ci.org/mickaelvieira/dom-element-wrapper.svg?branch=master)](https://travis-ci.org/mickaelvieira/dom-element-wrapper)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://github.com/mickaelvieira/dom-element-wrapper/blob/master/LICENSE.md)

## Motivation

This module aims to provide a more friendly interface when it comes to creating
nodes using the DOM API.
If like me, you like chaining stuff and you feel sad when you have to use the OM API, this library is made for you.

## Install

```
$ npm i --save dom-element-wrapper
```

or

```
$ yarn add dom-element-wrapper
```

## Usage



```
import { createWrapper } from "dom-element-wrapper";

const element = createWrapper("div")
  .setAttribute("id", "element-id")
  .appendWrappers(
    createWrapper("div").appendWrappers(
      createWrapper("p").appendTextNode("Lorem ipsum")
    ),
    createWrapper("ul").appendWrappers(
      createWrapper("li").appendTextNode("item 1"),
      createWrapper("li").appendTextNode("item 2"),
      createWrapper("li").appendTextNode("item 3"),
      createWrapper("li").appendTextNode("item 4"),
      createWrapper("li").appendTextNode("item 5")
    )
  )
  .unwrap();

document.querySelector("body").appendChild(element);
```

```
<div id="element-id">
  <div>
    <p>Lorem ipsum</p>
  </div>
  <ul>
    <li>item 1</li>
    <li>item 2</li>
    <li>item 3</li>
    <li>item 4</li>
    <li>item 5</li>
  </ul>
</div>
```

## Contributing

```
$ yarn run build
$ yarn run test
```
<commit_msg>Add limitation section to README file<commit_after># Element Wrapper

[![Build Status](https://travis-ci.org/mickaelvieira/dom-element-wrapper.svg?branch=master)](https://travis-ci.org/mickaelvieira/dom-element-wrapper)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://github.com/mickaelvieira/dom-element-wrapper/blob/master/LICENSE.md)

## Motivation

This module aims to provide a more friendly interface when it comes to creating
nodes using the DOM API.
If like me, you like chaining stuff and you feel sad when you have to use the OM API, this library is made for you.

## Limitation

The library relies on the [Proxy](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Proxy) object which is not
yet supported by [all browsers](http://kangax.github.io/compat-table/es6/#Proxy) and cannot be [transpiled or polyfilled](https://babeljs.io/learn-es2015/#ecmascript-2015-features-proxies).

## Install

```
$ npm i --save dom-element-wrapper
```

or

```
$ yarn add dom-element-wrapper
```

## Usage



```
import { createWrapper } from "dom-element-wrapper";

const element = createWrapper("div")
  .setAttribute("id", "element-id")
  .appendWrappers(
    createWrapper("div").appendWrappers(
      createWrapper("p").appendTextNode("Lorem ipsum")
    ),
    createWrapper("ul").appendWrappers(
      createWrapper("li").appendTextNode("item 1"),
      createWrapper("li").appendTextNode("item 2"),
      createWrapper("li").appendTextNode("item 3"),
      createWrapper("li").appendTextNode("item 4"),
      createWrapper("li").appendTextNode("item 5")
    )
  )
  .unwrap();

document.querySelector("body").appendChild(element);
```

```
<div id="element-id">
  <div>
    <p>Lorem ipsum</p>
  </div>
  <ul>
    <li>item 1</li>
    <li>item 2</li>
    <li>item 3</li>
    <li>item 4</li>
    <li>item 5</li>
  </ul>
</div>
```

## Contributing

```
$ yarn run build
$ yarn run test
```

{'fraction_non_alphanumeric': 0.16922647305222005, 'fraction_numerical': 0.00809829656520525, 'mean_word_length': 4.146551724137931, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1479212', 'n_tokens_mistral': 1255, 'n_tokens_neox': 1185, 'n_words': 256}