🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

hyperhtml-wire

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyperhtml-wire

The persistent fragment like class used in hyperHTML

2.1.1
latest
npm
Version published
Weekly downloads
2.9K
12.8%
Maintainers
1
Weekly downloads
 
Created
Source

hyperhtml-wire

Build Status Coverage Status Greenkeeper badge WebReflection status

The persistent fragment like class used in hyperHTML.

This is particularly useful with domdiff so it's been extracted from hyperHTML itself..

If you're looking for a smaller, modern, faster, alternative, check µwire out 😉

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

Keywords

hyperHTML

FAQs

Package last updated on 29 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts