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

vtree

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vtree

a realtime tree diffing algorithm

  • 0.0.16
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
242
increased by0.41%
Maintainers
1
Weekly downloads
 
Created
Source

vtree

A realtime tree diffing algorithm

Motivation

vtree currently exists as part of virtual-dom. It is used for imitating diff operations between two vnode structures that imitate the structure of the active DOM node structure in the browser.

This module is currently re-exporting the vtree from virtual-dom, but the aim is to eventually make this a standalone module and have virtual-dom depend on vtree instead.

Example

var VNode = require("vtree/vnode")
var diff = require("vtree/diff")

var leftNode = new VNode("div")
var rightNode = new VNode("text")

var patches = diff(leftNode, rightNode)
/*
  -> {
    a: lefNode,
    0: vpatch<REPLACE>(rightNode) // a replace operation for the first node
  }
*/

Installation

npm install vtree

Contributors

  • Matt Esch

MIT Licenced

FAQs

Package last updated on 23 Jul 2014

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