# hyperhtml-wire

> The persistent fragment like class used in hyperHTML

Latest version **2.1.1** (published 2020-03-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install hyperhtml-wire
pnpm add hyperhtml-wire
yarn add hyperhtml-wire
bun add hyperhtml-wire
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2020-03-29 |
| First published | 2019-01-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Andrea Giammrchi |
| Maintainers | webreflection |
| Keywords | hyperHTML, wire, class, fragment, persistent |

## Links

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

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

- 2.1.1 (latest) — 2020-03-29
- 2.1.0 — 2019-01-12
- 2.0.2 — 2019-01-12
- 2.0.1 — 2019-01-11
- 2.0.0 — 2019-01-11
- 1.0.0 — 2019-01-10

## README

# hyperhtml-wire

[![Build Status](https://travis-ci.com/WebReflection/hyperhtml-wire.svg?branch=master)](https://travis-ci.com/WebReflection/hyperhtml-wire) [![Coverage Status](https://coveralls.io/repos/github/WebReflection/hyperhtml-wire/badge.svg?branch=master)](https://coveralls.io/github/WebReflection/hyperhtml-wire?branch=master) [![Greenkeeper badge](https://badges.greenkeeper.io/WebReflection/hyperhtml-wire.svg)](https://greenkeeper.io/) ![WebReflection status](https://offline.report/status/webreflection.svg)

The persistent fragment like class used in [hyperHTML](https://github.com/WebReflection/hyperHTML).

This is particularly useful with [domdiff](https://github.com/WebReflection/domdiff) so it's been extracted from _hyperHTML_ itself..

If you're looking for a smaller, modern, faster, alternative, check [µwire](https://github.com/WebReflection/uwire#readme) out 😉

```js
import Wire from 'hyperhtml-wire';

const wire = new Wire(document.body.querySelectorAll('*'));

wire.firstChild;    // first body element
wire.lastChild;     // last body element
wire.childNodes;    // an array of initial nodes
wire.ownerDocument; // the document of the first child

wire.remove(true);  // remove all but first node (domdiff friendly)
wire.remove(false); // remove all nodes

wire.valueOf(true); // force nodes to be re-appended to a fragment
wire.valueOf(false);// returns fragment with nodes only if not appended

```

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