# domspace

> Adjust the text nodes in an HTML DOM so that the document is pretty-printed when serialized

Latest version **2.0.0** (published 2020-02-03) · BSD-3-Clause license · 0 weekly downloads

## Install

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

## 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 | 2.0.0 |
| Published | 2020-02-03 |
| First published | 2018-09-22 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Andreas Lind |
| Maintainers | papandreou |

## Links

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

## Recent versions

- 2.0.0 (latest) — 2020-02-03
- 1.2.2 — 2019-06-23
- 1.2.1 — 2018-10-30
- 1.2.0 — 2018-09-23
- 1.1.1 — 2018-09-22
- 1.1.0 — 2018-09-22
- 1.0.0 — 2018-09-22

## README

# domspace

Adjust the text nodes in an HTML DOM so that the document is pretty-printed when serialized.

Note that the supplied node and its children will be altered.
If you'd rather create a copy that's ready for pretty printing,
you can deep-clone it first using the DOM API:

```js
const prettyNode = domspace(node.cloneNode(true));
```

## Installation

```
npm install domspace
```

## Example

```js
const domspace = require('domspace');
const myDiv = document.createElement('div');
myDiv.innerHTML = '<span><i>foo</i></span>';
domspace(myDiv);
console.log(myDiv.outerHTML);
```

Output:

```html
<div>
  <span>
    <i>foo</i>
  </span>
</div>
```

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