<commit_before># dommodule

<em>work in progress</em>

The **dommodule** is a JavaScript library of DOM node assemblers.

- [document](lib/document.js) — `Document` node assembler
- [doctype](lib/doctype.js) — `DocumentType` node assembler (XML: `<!DOCTYPE example>`)
- [fragment](lib/fragment.js) — `DocumentFragment` node assembler 
- [element](lib/element.js) — `Element` node assembler (XML: `<example/>`)
- [text](lib/text.js) — `Text` node assembler (XML: `example`)
- [comment](lib/comment.js) — `Comment` node assembler (XML: `<!--example-->`)
- [instruction](lib/instruction.js) — `ProcessingInstruction` node assembler (XML: `<?test example?>`)

## Installation

```
npm install dommodule
```

## Example

```js
import {
    DocumentAssembler,
    attr, comment, doctype, element,
    fragment, instruction, text
} from '../lib'

new DocumentAssembler([
    doctype('example'),
    fragment([
        instruction({
            target : 'xml-stylesheet',
            attrset : { href : './example.css' }
        }),
        element({
            localName : 'example',
            attributes : attr({
                name : 'role',
                value : 'application'
            }),
            childNodes : [
                comment('Version 1.0.0'),
                text('Hello world!')
            ]<commit_msg>README: edit<commit_after># dommodule

<em>work in progress</em>

The **dommodule** is a JavaScript library of DOM node assemblers.

- [attr](lib/attr.js) — `Attr` node assembler (XML: `test="example"`)
- [document](lib/document.js) — `Document` node assembler
- [doctype](lib/doctype.js) — `DocumentType` node assembler (XML: `<!DOCTYPE test>`)
- [fragment](lib/fragment.js) — `DocumentFragment` node assembler 
- [element](lib/element.js) — `Element` node assembler (XML: `<example/>`)
- [text](lib/text.js) — `Text` node assembler (XML: `test`)
- [comment](lib/comment.js) — `Comment` node assembler (XML: `<!--example-->`)
- [instruction](lib/instruction.js) — `ProcessingInstruction` node assembler (XML: `<?test example?>`)

## Installation

```
npm install dommodule
```

## Example

```js
import {
    DocumentAssembler,
    attr, comment, doctype, element,
    fragment, instruction, text
} from '../lib'

new DocumentAssembler([
    doctype('example'),
    fragment([
        instruction({
            target : 'xml-stylesheet',
            attributes : attr({ name : 'role', value : 'application' }),
        }),
        element({
            localName : 'example',
            attrset : { role : 'application' },
            childNodes : [
                comment('Version 1.0.0'),
                text('Hello world!')
            ]
{'fraction_non_alphanumeric': 0.16741573033707866, 'fraction_numerical': 0.0022471910112359553, 'mean_word_length': 2.815714285714286, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '5021922', 'n_tokens_mistral': 836, 'n_tokens_neox': 786, 'n_words': 214}