{"_id":"marko-vdom","_rev":"13-3ae4b32cdb50b15f6f3376d8200a1ac7","name":"marko-vdom","description":"Virtual DOM implementation for use with Marko and/or morphdom","dist-tags":{"latest":"1.0.1"},"versions":{"0.1.0":{"name":"marko-vdom","version":"0.1.0","description":"Virtual DOM implementation for use with Marko and/or morphdom","main":"src/index.js","scripts":{"test":"npm run mocha && npm run jshint","mocha":"mocha --ui bdd --reporter spec ./test/","mocha-debug":"node-debug _mocha ./test/","jshint":"jshint src/","benchmark":"matcha benchmark/*.js","test-coverage":"istanbul cover _mocha -- --ui bdd --reporter spec ./test/ && npm run jshint","coveralls":"cat ./coverage/lcov.info | coveralls"},"keywords":["vdom","dom","marko","morphdom","virtual","virtual-dom"],"author":{"name":"Patrick Steele-Idem","email":"pnidem@gmail.com"},"license":"MIT","devDependencies":{"chai":"^3.5.0","coveralls":"^2.11.12","istanbul":"^0.4.5","jsdom":"^9.4.2","jshint":"^2.9.3","mocha":"^3.0.2"},"dependencies":{"raptor-util":"^2.0.0"},"gitHead":"a01cc39dc46f2cec7177606ac1c78f9cebceeb5a","_id":"marko-vdom@0.1.0","_shasum":"e45d40f7fb98f5bba4633a17eb8aa705d54d12e9","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.3","_npmUser":{"name":"pnidem","email":"pnidem@gmail.com"},"dist":{"shasum":"e45d40f7fb98f5bba4633a17eb8aa705d54d12e9","tarball":"https://registry.npmjs.org/marko-vdom/-/marko-vdom-0.1.0.tgz","integrity":"sha512-nQddo3sL7g9WVkKqCwM40c0HbCDzTaYk4XV271d00eUZw9kNG9tfHEmd8NfVnBMr7xyMmR0H45wRSOCT8fIyyw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOQyXclw9aD24dsVkxTRCxYFpB4qP69w227WLthdb6fwIhAKfRCNSOOuuyTnVMl8SaOfjk+j83C8+Iq+saB34zC4TB"}]},"maintainers":[{"name":"pnidem","email":"pnidem@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/marko-vdom-0.1.0.tgz_1473371464599_0.00698050856590271"}},"0.2.0":{"name":"marko-vdom","version":"0.2.0","description":"Virtual DOM implementation for use with Marko and/or morphdom","main":"src/index.js","scripts":{"test":"npm run mocha && npm run jshint","mocha":"mocha --ui bdd --reporter spec ./test/","mocha-debug":"node-debug _mocha ./test/","jshint":"jshint src/","benchmark":"node benchmark/run.js","test-coverage":"istanbul cover _mocha -- --ui bdd --reporter spec ./test/ && npm run jshint","coveralls":"cat ./coverage/lcov.info | coveralls","dist":"mkdir -p dist && browserify src/all.js > dist/marko-vdom-umd.js --standalone MarkoVDOM"},"keywords":["vdom","dom","marko","morphdom","virtual","virtual-dom"],"author":{"name":"Patrick Steele-Idem","email":"pnidem@gmail.com"},"license":"MIT","devDependencies":{"benchmark":"^2.1.1","chai":"^3.5.0","coveralls":"^2.11.12","istanbul":"^0.4.5","jsdom":"^9.4.2","jshint":"^2.9.3","lodash":"^4.15.0","mocha":"^3.0.2","open":"0.0.5"},"dependencies":{"raptor-util":"^2.0.0"},"gitHead":"82b84538d97f43595af780d0d12a7ffc3a3a0205","_id":"marko-vdom@0.2.0","_shasum":"5f325ebf0b7226f01189a550273b19e1a43750b1","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.3","_npmUser":{"name":"pnidem","email":"pnidem@gmail.com"},"dist":{"shasum":"5f325ebf0b7226f01189a550273b19e1a43750b1","tarball":"https://registry.npmjs.org/marko-vdom/-/marko-vdom-0.2.0.tgz","integrity":"sha512-DbCY0lepAerlMEg675bWh1nvAGsZ6rRNYKyxNY6M9SmnObO+tIFzF3ZVaOGpfbFhr8p/klC7Thydfh7eIpehcw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE4D4zUvii9xKTJ6Pb5M+Pcbkw88d5v0rcVapub30hnGAiEAqUWfR0FKPjc1hEqTDTRlIoSBPw9finpWbILlrwQ+aO4="}]},"maintainers":[{"name":"pnidem","email":"pnidem@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/marko-vdom-0.2.0.tgz_1473716652577_0.3704627947881818"}},"0.3.0":{"name":"marko-vdom","version":"0.3.0","description":"Virtual DOM implementation for use with Marko and/or morphdom","main":"src/index.js","scripts":{"test":"npm run mocha && npm run jshint","mocha":"mocha --ui bdd --reporter spec ./test/","mocha-debug":"node-debug _mocha ./test/","jshint":"jshint src/","benchmark":"node benchmark/run.js","test-coverage":"istanbul cover _mocha -- --ui bdd --reporter spec ./test/ && npm run jshint","coveralls":"cat ./coverage/lcov.info | coveralls","dist":"mkdir -p dist && browserify src/all.js > dist/marko-vdom-umd.js --standalone MarkoVDOM"},"keywords":["vdom","dom","marko","morphdom","virtual","virtual-dom"],"author":{"name":"Patrick Steele-Idem","email":"pnidem@gmail.com"},"license":"MIT","devDependencies":{"benchmark":"^2.1.1","chai":"^3.5.0","coveralls":"^2.11.12","istanbul":"^0.4.5","jsdom":"^9.4.2","jshint":"^2.9.3","lodash":"^4.15.0","mocha":"^3.0.2","open":"0.0.5"},"dependencies":{"raptor-util":"^2.0.0"},"gitHead":"2b9ca54d2c37dc590a5ce4e6a0a66c699be372d8","_id":"marko-vdom@0.3.0","_shasum":"e0f75b45766f9726dab739352e981d0e8713d1b3","_from":".","_npmVersion":"2.15.1","_nodeVersion":"4.4.3","_npmUser":{"name":"pnidem","email":"pnidem@gmail.com"},"dist":{"shasum":"e0f75b45766f9726dab739352e981d0e8713d1b3","tarball":"https://registry.npmjs.org/marko-vdom/-/marko-vdom-0.3.0.tgz","integrity":"sha512-UincElWf53hlfbPhJD63B8evKeQ/RySb2Fbo9SVmhpXKSy9oiyCCiIngzweum42hbjn/T3TFYO1XBmGai2nZ2A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLBsK4MOvL5q92mzBov8DYE0CYUP7SJ/SQk6yk0cosawIgJXpZUudkl9v+WK7K8BMgpJdaiS2Rs7U9cVs637jxiJo="}]},"maintainers":[{"name":"pnidem","email":"pnidem@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/marko-vdom-0.3.0.tgz_1473720521762_0.33406199840828776"}},"0.4.0":{"name":"marko-vdom","version":"0.4.0","description":"Virtual DOM implementation for use with Marko and/or morphdom","main":"src/index.js","scripts":{"test":"npm run mocha && npm run jshint","mocha":"mocha --ui bdd --reporter spec ./test/","mocha-debug":"node-debug _mocha ./test/","jshint":"jshint src/","benchmark":"node benchmark/run.js","test-coverage":"istanbul cover _mocha -- --ui bdd --reporter spec ./test/ && npm run jshint","coveralls":"cat ./coverage/lcov.info | coveralls","dist":"mkdir -p dist && browserify src/all.js > dist/marko-vdom-umd.js --standalone MarkoVDOM"},"keywords":["vdom","dom","marko","morphdom","virtual","virtual-dom"],"author":{"name":"Patrick Steele-Idem","email":"pnidem@gmail.com"},"license":"MIT","devDependencies":{"benchmark":"^2.1.1","chai":"^3.5.0","coveralls":"^2.11.12","istanbul":"^0.4.5","jsdom":"^9.4.2","jshint":"^2.9.3","lodash":"^4.15.0","mocha":"^3.0.2","open":"0.0.5"},"dependencies":{"raptor-util":"^2.0.0"},"gitHead":"3211f93cfb10fe23365414741efbeed5ffa0e099","_id":"marko-vdom@0.4.0","_shasum":"ff96b0c778040bd25ca3495fd6a5e0a563813aba","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.5.0","_npmUser":{"name":"pnidem","email":"pnidem@gmail.com"},"dist":{"shasum":"ff96b0c778040bd25ca3495fd6a5e0a563813aba","tarball":"https://registry.npmjs.org/marko-vdom/-/marko-vdom-0.4.0.tgz","integrity":"sha512-bEti+nlSFtKWJBVNDz+aqu0JY72n/jEwFXBWB2dG/1JIOncZqq+Bg5Ut3HqfjQS+k4W+V8kbYxu/Ym3Qg92qPQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDv7YNipL40xlZsF7daVOYKhlrgJUBnhAN7rZIjavQAFwIhAJMRV1QHgNd62zTcZvr/DCxlMoo2n55N7t1XmbLAGhUq"}]},"maintainers":[{"name":"pnidem","email":"pnidem@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/marko-vdom-0.4.0.tgz_1476229807289_0.37351175071671605"}},"0.4.1":{"name":"marko-vdom","version":"0.4.1","description":"Virtual DOM implementation for use with Marko and/or morphdom","main":"src/index.js","scripts":{"test":"npm run mocha && npm run jshint","mocha":"mocha --ui bdd --reporter spec ./test/","mocha-debug":"node-debug _mocha ./test/","jshint":"jshint src/","benchmark":"node benchmark/run.js","test-coverage":"istanbul cover _mocha -- --ui bdd --reporter spec ./test/ && npm run jshint","coveralls":"cat ./coverage/lcov.info | coveralls","dist":"mkdir -p dist && browserify src/all.js > dist/marko-vdom-umd.js --standalone MarkoVDOM"},"keywords":["vdom","dom","marko","morphdom","virtual","virtual-dom"],"author":{"name":"Patrick Steele-Idem","email":"pnidem@gmail.com"},"license":"MIT","devDependencies":{"benchmark":"^2.1.1","chai":"^3.5.0","coveralls":"^2.11.12","istanbul":"^0.4.5","jsdom":"^9.4.2","jshint":"^2.9.3","lodash":"^4.15.0","mocha":"^3.0.2","open":"0.0.5"},"dependencies":{"raptor-util":"^2.0.0"},"gitHead":"04f350c763491fb58e324ce707958c9a08000ba8","_id":"marko-vdom@0.4.1","_shasum":"9c9050086a87b76b4666dce261842e9d05be1c44","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.5.0","_npmUser":{"name":"pnidem","email":"pnidem@gmail.com"},"dist":{"shasum":"9c9050086a87b76b4666dce261842e9d05be1c44","tarball":"https://registry.npmjs.org/marko-vdom/-/marko-vdom-0.4.1.tgz","integrity":"sha512-oajWYe0qva92qGr9VWYrW5rOaKRAMzx2gP59+qX73aV2DHgpIihPaH90G8KbRiVsuWcuR4ObES71VfgBMWZEXQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID6MkNYCYem0+TZT1XPHpnijPajh1VpH1TpYdjxpE+4kAiB/oPtR0ghYhrIEt7nofw+/FtWfKz+OfOZV4z6Dv6UzzA=="}]},"maintainers":[{"name":"pnidem","email":"pnidem@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/marko-vdom-0.4.1.tgz_1476473464679_0.4050637523178011"}},"0.4.2":{"name":"marko-vdom","version":"0.4.2","description":"Virtual DOM implementation for use with Marko and/or morphdom","main":"src/index.js","scripts":{"test":"npm run mocha && npm run jshint","mocha":"mocha --ui bdd --reporter spec ./test/","mocha-debug":"node-debug _mocha ./test/","jshint":"jshint src/","benchmark":"node benchmark/run.js","test-coverage":"istanbul cover _mocha -- --ui bdd --reporter spec ./test/ && npm run jshint","coveralls":"cat ./coverage/lcov.info | coveralls","dist":"mkdir -p dist && browserify src/all.js > dist/marko-vdom-umd.js --standalone MarkoVDOM"},"keywords":["vdom","dom","marko","morphdom","virtual","virtual-dom"],"author":{"name":"Patrick Steele-Idem","email":"pnidem@gmail.com"},"license":"MIT","devDependencies":{"benchmark":"^2.1.1","chai":"^3.5.0","coveralls":"^2.11.12","istanbul":"^0.4.5","jsdom":"^9.4.2","jshint":"^2.9.3","lodash":"^4.15.0","mocha":"^3.0.2","open":"0.0.5"},"dependencies":{"raptor-util":"^2.0.0"},"gitHead":"2bf73c23356e581339d3935be777032c54066df0","_id":"marko-vdom@0.4.2","_shasum":"96cc812aa444203c5712aeed37d293faf1f8d02f","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.5.0","_npmUser":{"name":"pnidem","email":"pnidem@gmail.com"},"dist":{"shasum":"96cc812aa444203c5712aeed37d293faf1f8d02f","tarball":"https://registry.npmjs.org/marko-vdom/-/marko-vdom-0.4.2.tgz","integrity":"sha512-40mW4lSskOUag9DHrl42GG18Vnw7KIVNnKQlGAG/4EWLJsG19DcbYtoIXy2Rea108bZhkp6SbbTpmXeQqJd5mQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpyWNq2y1o45EMQMCZ0sCJoYeeQivI3zIuYTiO5uNLtwIhAJ2VsDX6sHpbuM1UpE39/mhaGkHmHBX3t5EfYuv+0bGp"}]},"maintainers":[{"name":"pnidem","email":"pnidem@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/marko-vdom-0.4.2.tgz_1477679595078_0.5493690352886915"}},"1.0.0":{"name":"marko-vdom","version":"1.0.0","description":"Virtual DOM implementation for use with Marko and/or morphdom","main":"src/index.js","scripts":{"test":"npm run mocha && npm run jshint","mocha":"mocha --ui bdd --reporter spec ./test/","mocha-debug":"node-debug _mocha ./test/","jshint":"jshint src/","benchmark":"node benchmark/run.js","test-coverage":"istanbul cover _mocha -- --ui bdd --reporter spec ./test/ && npm run jshint","coveralls":"cat ./coverage/lcov.info | coveralls","dist":"mkdir -p dist && browserify src/all.js > dist/marko-vdom-umd.js --standalone MarkoVDOM"},"keywords":["vdom","dom","marko","morphdom","virtual","virtual-dom"],"author":{"name":"Patrick Steele-Idem","email":"pnidem@gmail.com"},"license":"MIT","devDependencies":{"benchmark":"^2.1.1","chai":"^3.5.0","coveralls":"^2.11.12","istanbul":"^0.4.5","jsdom":"^9.4.2","jshint":"^2.9.3","lodash":"^4.15.0","mocha":"^3.0.2","open":"0.0.5"},"dependencies":{"raptor-util":"^2.0.0"},"gitHead":"efb71b8d09641f483aae1d3e9d46069cb98047e3","_id":"marko-vdom@1.0.0","_shasum":"e641e080fb0e082db802c72207139db68df632d9","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.5.0","_npmUser":{"name":"pnidem","email":"pnidem@gmail.com"},"dist":{"shasum":"e641e080fb0e082db802c72207139db68df632d9","tarball":"https://registry.npmjs.org/marko-vdom/-/marko-vdom-1.0.0.tgz","integrity":"sha512-87lSWhtQAV2hxh4nMYk/rWgz6h4cP4peoa7LDcJeNtm4woqSsR1/8gXc01ND510v7dw08NiAGpHMTNlyzO1WZQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBXlYNHEJBhfkPIQeY4nm4/sB3lQrFK9DqMqsUxdTNDjAiEAru8OE5Vb+AA93CWdy8Nqz/06zjpXrWUI6RdjR2Uoytk="}]},"maintainers":[{"name":"pnidem","email":"pnidem@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/marko-vdom-1.0.0.tgz_1477950039188_0.2706150892190635"}},"1.0.1":{"name":"marko-vdom","version":"1.0.1","description":"Virtual DOM implementation for use with Marko and/or morphdom","main":"src/index.js","scripts":{"test":"npm run mocha && npm run jshint","mocha":"mocha --ui bdd --reporter spec ./test/","mocha-debug":"node-debug _mocha ./test/","jshint":"jshint src/","benchmark":"node benchmark/run.js","test-coverage":"istanbul cover _mocha -- --ui bdd --reporter spec ./test/ && npm run jshint","coveralls":"cat ./coverage/lcov.info | coveralls","dist":"mkdir -p dist && browserify src/all.js > dist/marko-vdom-umd.js --standalone MarkoVDOM"},"keywords":["vdom","dom","marko","morphdom","virtual","virtual-dom"],"author":{"name":"Patrick Steele-Idem","email":"pnidem@gmail.com"},"license":"MIT","devDependencies":{"benchmark":"^2.1.1","chai":"^3.5.0","coveralls":"^2.11.12","istanbul":"^0.4.5","jsdom":"^9.4.2","jshint":"^2.9.3","lodash":"^4.15.0","mocha":"^3.0.2","open":"0.0.5"},"dependencies":{"raptor-util":"^2.0.0"},"gitHead":"31187e8b28771cdf0fc86adfaa0efb777241c44c","_id":"marko-vdom@1.0.1","_shasum":"dd0bd16ea7f593dc94ad19b97df683dc320ff6d2","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.5.0","_npmUser":{"name":"pnidem","email":"pnidem@gmail.com"},"dist":{"shasum":"dd0bd16ea7f593dc94ad19b97df683dc320ff6d2","tarball":"https://registry.npmjs.org/marko-vdom/-/marko-vdom-1.0.1.tgz","integrity":"sha512-mpyP5YyaAdlS2XzpqZebV5tShYbEzaH+KiwrXZFgKu5+vUypfxhvXKXjgODI1GDyD8zDkvpiWgP2UDXOw1MOnA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBanfi+0qnl6l3rN6Y8Gvg/oSfC8EQuW53zpn0CO4LsHAiBCfb8gRbIvmkvXzVxVp2l+c4+R0f/DIOOxp1ziIdeGXQ=="}]},"maintainers":[{"name":"pnidem","email":"pnidem@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/marko-vdom-1.0.1.tgz_1478019679271_0.5228559274692088"}}},"readme":"marko-vdom\n==========\n\nThis module provides an optimized virtual DOM implementation where each virtual DOM node is API compatible with real DOM nodes for the minimal subset that is required to support DOM diffing/patching using [morphdom](https://github.com/patrick-steele-idem/morphdom).\n\n[![Build Status](https://travis-ci.org/marko-js/marko-vdom.svg?branch=master)](https://travis-ci.org/marko-js/marko-vdom)\n[![Coverage Status](https://coveralls.io/repos/github/marko-js/marko-vdom/badge.svg?branch=master)](https://coveralls.io/github/marko-js/marko-vdom?branch=master)\n[![NPM](https://img.shields.io/npm/v/marko-vdom.svg)](https://www.npmjs.com/package/marko-vdom)\n\n# Overview\n\nEach virtual DOM node supports the following properties and methods required by [morphdom](https://github.com/patrick-steele-idem/morphdom):\n\n- `node.firstChild`\n- `node.nextSibling`\n- `node.nodeType`\n- `node.nodeName`\n- `node.namespaceURI`\n- `node.nodeValue`\n- `node.attributes` <sup><a href=\"#attributes\">[1]</a><sup>\n- `node.value`\n- `node.selected`\n- `node.disabled`\n- `node.actualize(document)` <sup><a href=\"#actualize\">[2]</a><sup>\n- `node.hasAttributeNS(namespaceURI, name)`\n- `node.isSameNode(anotherNode)` <sup><a href=\"#isSameNode\">[3]</a><sup>\n- `node.assignAttributes(targetNode)` <sup><a href=\"#assignAttributes\">[4]</a><sup>\n\nNOTES:\n\n1. <a name=\"attributes\"></a>Unlike with real DOM nodes, `node.attributes` can either be an `Array` of [Attr](https://developer.mozilla.org/en-US/docs/Web/API/Attr) objects or an `Object` (where each property represents an attribute. e.g., `{ \"class\": \"foo\", \"id\": \"bar\" }`)\n2. <a name=\"actualize\"></a>In addition to the standard DOM node methods and properties, a virtual DOM node must also provide a `node.actualize(document)` method. The `node.actualize(document)` will be called when the virtual DOM node needs to be upgraded to a real DOM node so that it can be moved into the real DOM.\n3. <a name=\"isSameNode\"></a>A virtual DOM node may choose to implement `isSameNode(anotherNode)` to short-circuit diffing/patching a particular DOM subtree by treating two nodes as the \"same\"\n4. <a name=\"assignAttributes\"></a>A virtual DOM node may choose to implement the non-standard `assignAttributes(targetNode)` to optimize copying the attributes from the virtual DOM node to the target DOM node\n\n`marko-vdom` is namespace aware and will work correctly with SVG and MathML elements.\n\nWhile `marko-vdom` exposes an API that can be used directly, the terse API is designed to be used with a compiler that generates JavaScript code.\n\n# Usage\n\n## Create an element with a fixed number of attributes and a fixed number of children\n\n```javascript\nvar createElement = require('marko-vdom').createElement;\n\ncreateElement('div', { class: 'foo', onclick: 'doSomething()' }, 2 /* childCount */)\n    .e('span', null, 1)\n        .e('b', null, 1)\n            .t('Hello World!')\n    .e('a', { href: 'http://ebay.com' }, 1)\n        .t('eBay')\n```\n\nThe above code will generate a virtual DOM tree that mirrors the following:\n\n```html\n<div class=\"foo\" onclick=\"doSomething()\">\n    <span>\n        <b>Hello World!</b>\n    </span>\n    <a href=\"http://ebay.com\">eBay</a>\n</div>\n```\n\n## Dynamic HTML with a unknown number of children\n\n```javascript\nvar createElement = require('marko-vdom').createElement;\n\nvar el = createElement('div', { class: 'foo' });\nel.appendChild(createElement('span', { class: 'bar' }));\n```\n\nThe above code will generate a virtual DOM tree that mirrors the following:\n\n```html\n<div class=\"foo\">\n    <span class=\"bar\"></span>\n</div>\n```\n\n## Static subtree\n\n```javascript\nvar createElement = require('marko-vdom').createElement;\n\nvar staticLink = createElement('a', { href: 'http://ebay.com' }, 1 /* childCount */, 'abc123' /* key */)\n    .t('eBay')\n\nfunction render() {\n    createElement('div', null, 1 /* childCount */)\n        .n(staticLink);\n}\n```\n\nThe above code will generate a virtual DOM tree that, when converted to a real DOM, will be the following:\n\n```html\n<div>\n    <a href=\"http://ebay.com\" data-marko-same-id=\"abc123\">\n        eBay\n    </a>\n</div>\n```\n\nFor the static link, both the virtual DOM node and the real DOM node will be marked with an \"id\" that identifies the two nodes as the \"same\" node in order to short-circuit DOM/diffing patching. That is:\n\n```javascript\nvar realStaticLink = staticLink.actualize(document);\nconsole.log(staticLink.isSameNode(realStaticLink)); //Output: true\n```\n\n## Document fragments\n\nDocument fragments are containers for child nodes that can be appended as children nodes, but the actual `DocumentFragment` node is never directly visited when walking the DOM using `node.firstChild` and `node.nextSibling`. Instead, the children (if any) of a `DocumentFragment` node are treated as direct children of the parent of the `DocumentFragment` node. A `DocumentFragment` node can be modified with new children even after it has been inserted into the DOM.\n\n```javascript\nvar createElement = require('marko-vdom').createElement;\n\nvar div = createElement('div');\ndocumentFragment.appendChild(createElement('div'));\n\nvar documentFragment = div.appendDocumentFragment();\ndocumentFragment.appendChild(createElement('span', { class: 'foo' }));\ndocumentFragment.appendChild(createElement('span', { class: 'bar' }));\n\n/*\n\nOutput DOM:\n\n<div>\n    <span class=\"foo\"></span>\n    <span class=\"bar\"></span>\n</div>\n*/\n\n```\n\n<a name=\"benchmarks\"></a>\n\n# Benchmarks\n\nThis library includes some benchmarks to compare performance with the real DOM (and React). To run the benchmarks:\n\n```\nnpm run benchmark\n```\n\nThis will open a web page in your browser that you can use to run a variety of benchmarks.\n\nWe are interested in the following performance characteristics:\n\n- <b>Creation time</b> - the time it takes to construct a [virtual] DOM tree\n- <b>Walk time</b> - the time it takes to walk a [virtual] DOM tree using `firstChild` and `nextSibilng`\n\nWe encourage you to run the benchmarks on your machine and in various browsers. If you see any problems with the benchmarks, or if you would like clarifying information please open a Github issue.\n\nPlease see [Benchmark Results](./docs/benchmark-results.md) for more detailed numbers.\n\n# API\n\n## `marko-vdom`\n\n### Methods\n\n#### `createElement(tagName, attrCount, childCount, key)`\n\nReturns a new [HTMLElement](#HTMLElement).\n\n#### `createText(value)`\n\nReturns a new [Text](#Text).\n\n#### `createComment(value)`\n\nReturns a new [Comment](#Comment).\n\n#### `createAttributes(attrCount)`\n\nReturns a new [AttributeCollection](#AttributeCollection).\n\n#### `createDocumentFragment()`\n\nReturns a new [DocumentFragment](#DocumentFragment)\n\n---------------\n\n<a name=\"AttributeCollection\"></a>\n\n## `AttributeCollection`\n\n### Methods\n\n<a name=\"AttributeCollection-a\"></a>\n\n#### `a(name, value)`\n\n<a name=\"AttributeCollection-as\"></a>\n\n#### `as(attributes)`\n\n---------------\n\n<a name=\"Comment\"></a>\n\n## `Comment`\n\n---------------\n\n<a name=\"DocumentFragment\"></a>\n\n## `DocumentFragment`\n\n---------------\n\n<a name=\"HTMLElement\"></a>\n\n## `HTMLElement`\n\n### Constructors\n\n#### `HTMLElement(tagName, attrCount, childCount, key)`\n\nParameters:\n\n- __tagName__ - The tag name for the new HTML element (`String`)\n- __attrCount__ - The number of attributes (if known) (an integer, `null` or `undefined`)\n- __childCount__ - The number of child nodes (if known) (an integer, `null` or `undefined`)\n- __key__ - A key for static nodes to use for `isSameNode()` checks\n\n#### `HTMLElement(htmlElement)`\n\nUsed to do a shallow clone of another `HTMLElement`\n\n### Properties\n\n#### `nodeType`\n\nAlways set to `1`\n\n### Methods\n\n#### `a(name, value)` : [`Node`](#Node)\n\nSee [AttributeCollection#a](#AttributeCollection-a)\n\n#### `actualize(document)` : `HTMLElement`\n\nConverts the virtual `HTMLElement` tree to a real `HTMLElement` tree using the provided `document`.\n\n#### `as(name, value)` : [`Node`](#Node)\n\nSee [AttributeCollection#a](#AttributeCollection-as)\n\n#### `appendDocumentFragment()` : [`DocumentFragment`](#DocumentFragment)\n\nSee [Node#appendDocumentFragment](#Node-appendDocumentFragment)\n\n#### `c(value)` : [`Node`](#Node)\n\nShorthand method for creating a [Comment](#Comment) node and appending it as a child.\n\n#### `cloneNode()` : [`HTMLElement`](#HTMLElement)\n\nPerforms a shallow clone of the node (`nextSibling` and `parentNode` will be `undefined` since a cloned node will always start out as detached)\n\n#### `e(tagName, attrCount, childCount, key)` : [`Node`](#Node)\n\nShorthand method for creating an [HTMLElement](#HTMLElement) node and appending it as a child.\n\n#### `hasAttributeNS(namespaceURI, name)` : `boolean`\n\n#### `isSameNode(otherNode)` : `boolean`\n\nCalled by `morphdom` to determine if the target `HTMLElement` (either virtual or real) node is the same as the current node. The `key` passed in to the constructor is used to do determine if the other node is the \"same\" node. If the other node is a real DOM node then the key is pulled from the `data-markokey` attribute.\n\n#### `n(node)` : [`Node`](#Node)\n\nShorthand method for appending a node as a child. The provided is automatically cloned (using a shallow clone) since it is assumed that this method will be called to append a static/memoized DOM node and the original DOM node should not be modified.\n\n#### `t(value)` : [`Node`](#Node)\n\nShorthand method for creating a [Text](#Text) node and appending it as a child.\n\n---------------\n\n<a name=\"Node\"></a>\n\n## `Node`\n\n### Properties\n\n#### `firstChild` : [`Node`](#Node)\n\nReturns the first child node\n\n#### `nextSibling` : [`Node`](#Node)\n\nReturns the next sibling node\n\n### Methods\n\n<a name=\"Node-appendDocumentFragment\"></a>\n\n#### `appendDocumentFragment()` : [`DocumentFragment`](#DocumentFragment)\n\nCreates and appends a new [DocumentFragment](#DocumentFragment) node and appends it as a child and the newly created [DocumentFragment](#DocumentFragment) node is returned.\n\n#### `removeChildren()`\n\nClears out all child nodes\n\n\n\n---------------\n\n<a name=\"Text\"></a>\n\n## `Text`\n","maintainers":[{"email":"austin.kell47@gmail.com","name":"austinkelleher"},{"email":"pierceydylan@gmail.com","name":"dylanpiercey"},{"email":"ml.rawlings@gmail.com","name":"mlrawlings"},{"email":"pnidem@gmail.com","name":"pnidem"}],"time":{"modified":"2022-06-19T16:16:57.532Z","created":"2016-09-08T21:51:05.998Z","0.1.0":"2016-09-08T21:51:05.998Z","0.2.0":"2016-09-12T21:44:14.303Z","0.3.0":"2016-09-12T22:48:43.764Z","0.4.0":"2016-10-11T23:50:08.074Z","0.4.1":"2016-10-14T19:31:06.264Z","0.4.2":"2016-10-28T18:33:17.225Z","1.0.0":"2016-10-31T21:40:39.808Z","1.0.1":"2016-11-01T17:01:19.885Z"},"keywords":["vdom","dom","marko","morphdom","virtual","virtual-dom"],"author":{"name":"Patrick Steele-Idem","email":"pnidem@gmail.com"},"license":"MIT","readmeFilename":"README.md"}