Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

snabbdom-virtualize

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snabbdom-virtualize

Library for turning strings and DOM nodes into virtual DOM nodes compatible with snabbdom.

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

snabbdom-virtualize Build Status

Library for turning strings and DOM nodes into virtual DOM nodes compatible with Snabbdom.

Usage

Add it to your application with

npm install --save snabbdom-virtualize

Require/import it.

// ES6
import virtualize from 'snabbdom-virtualize';

// Require.
var virtualize = require('snabbdom-virtualize');

Pass it a set of DOM nodes or a string representing DOM nodes with one root node.

// Actual DOM nodes
var topNode = document.createElement('div');
var textNode = document.createTextNode('Click ');
var linkNode = document.createElement('a');
linkNode.setAttribute('href', 'http://example.com');
linkNode.textContent = 'here';
topNode.appendChild(textNode);
topNode.appendChild(linkNode);
var vnode = virtualize(topNode);

// String
var vnode = virtualize('<div>Click <a href="http://example.com">here</a>');

Project setup

Written in ES6, compiled using Babel. To get started:

npm install
npm run build

This will output a compiled index.js file in the root directory.

Tests

Tests can be run with npm test.

FAQs

Package last updated on 08 Feb 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc