{"_id":"dom-serialize","_rev":"347698","name":"dom-serialize","description":"Serializes any DOM node into a String","dist-tags":{"latest":"2.2.1"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"time":{"modified":"2021-07-07T06:31:13.000Z","created":"2015-01-17T00:46:09.519Z","2.2.1":"2015-11-05T18:04:28.006Z","2.2.0":"2015-02-13T19:22:10.774Z","2.1.0":"2015-02-10T20:50:42.997Z","2.0.1":"2015-02-04T04:43:52.362Z","2.0.0":"2015-02-04T03:55:37.509Z","1.2.1":"2015-02-04T00:07:50.164Z","1.2.0":"2015-02-03T01:41:24.384Z","1.1.0":"2015-01-17T00:46:09.519Z"},"users":{"danielkalen":true},"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"repository":{"type":"git","url":"git://github.com/webmodules/dom-serialize.git"},"versions":{"2.2.1":{"name":"dom-serialize","version":"2.2.1","description":"Serializes any DOM node into a String","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/webmodules/dom-serialize.git"},"keywords":["browser","node","dom","serialize","string"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/webmodules/dom-serialize/issues"},"homepage":"https://github.com/webmodules/dom-serialize","dependencies":{"custom-event":"~1.0.0","ent":"~2.2.0","extend":"^3.0.0","void-elements":"^2.0.0"},"devDependencies":{"zuul":"1"},"gitHead":"3e9706965c76cfc2a74a6f3c113f89bffd49cb29","_id":"dom-serialize@2.2.1","_shasum":"562ae8999f44be5ea3076f5419dcd59eb43ac95b","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.2","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"dist":{"shasum":"562ae8999f44be5ea3076f5419dcd59eb43ac95b","size":6304,"noattachment":false,"key":"/dom-serialize/-/dom-serialize-2.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/dom-serialize/download/dom-serialize-2.2.1.tgz"},"directories":{},"publish_time":1446746668006,"_cnpm_publish_time":1446746668006,"_hasShrinkwrap":false},"2.2.0":{"name":"dom-serialize","version":"2.2.0","description":"Serializes any DOM node into a String","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/webmodules/dom-serialize.git"},"keywords":["browser","node","dom","serialize","string"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/webmodules/dom-serialize/issues"},"homepage":"https://github.com/webmodules/dom-serialize","dependencies":{"custom-event":"~1.0.0","ent":"~2.2.0","extend":"~2.0.0","void-elements":"~1.0.0"},"devDependencies":{"zuul":"1"},"gitHead":"f2d60cf6ec92277fc1b27ed8b0d3be310178eaf0","_id":"dom-serialize@2.2.0","_shasum":"cc607ba627bd6104b89190da0978d58ba2e08471","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"dist":{"shasum":"cc607ba627bd6104b89190da0978d58ba2e08471","size":6288,"noattachment":false,"key":"/dom-serialize/-/dom-serialize-2.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/dom-serialize/download/dom-serialize-2.2.0.tgz"},"directories":{},"publish_time":1423855330774,"_cnpm_publish_time":1423855330774,"_hasShrinkwrap":false},"2.1.0":{"name":"dom-serialize","version":"2.1.0","description":"Serializes any DOM node into a String","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/webmodules/dom-serialize.git"},"keywords":["browser","node","dom","serialize","string"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/webmodules/dom-serialize/issues"},"homepage":"https://github.com/webmodules/dom-serialize","dependencies":{"custom-event":"~1.0.0","ent":"~2.2.0","void-elements":"~1.0.0"},"devDependencies":{"zuul":"1"},"gitHead":"6b00e804b36ba3be809560393275c886b2def87d","_id":"dom-serialize@2.1.0","_shasum":"152c51de73aff8095ac3f0fbb7655500218a05a6","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"dist":{"shasum":"152c51de73aff8095ac3f0fbb7655500218a05a6","size":6063,"noattachment":false,"key":"/dom-serialize/-/dom-serialize-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/dom-serialize/download/dom-serialize-2.1.0.tgz"},"directories":{},"publish_time":1423601442997,"_cnpm_publish_time":1423601442997,"_hasShrinkwrap":false},"2.0.1":{"name":"dom-serialize","version":"2.0.1","description":"Serializes any DOM node into a String","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/webmodules/dom-serialize.git"},"keywords":["browser","node","dom","serialize","string"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/webmodules/dom-serialize/issues"},"homepage":"https://github.com/webmodules/dom-serialize","dependencies":{"custom-event":"~1.0.0","ent":"~2.2.0","void-elements":"~1.0.0"},"devDependencies":{"zuul":"~1.16.3"},"gitHead":"3dc0ba6153943c5c088b7f46f3d6e356179091ef","_id":"dom-serialize@2.0.1","_shasum":"eca930179da7c3bf273b61debee3ef00124837f2","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"dist":{"shasum":"eca930179da7c3bf273b61debee3ef00124837f2","size":5896,"noattachment":false,"key":"/dom-serialize/-/dom-serialize-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/dom-serialize/download/dom-serialize-2.0.1.tgz"},"directories":{},"publish_time":1423025032362,"_cnpm_publish_time":1423025032362,"_hasShrinkwrap":false},"2.0.0":{"name":"dom-serialize","version":"2.0.0","description":"Serializes any DOM node into a String","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/webmodules/dom-serialize.git"},"keywords":["browser","node","dom","serialize","string"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/webmodules/dom-serialize/issues"},"homepage":"https://github.com/webmodules/dom-serialize","dependencies":{"custom-event":"~1.0.0","ent":"~2.2.0","void-elements":"~1.0.0"},"devDependencies":{"zuul":"~1.16.3"},"gitHead":"c86d26136346ecefd1ef339428e5b551a71f417f","_id":"dom-serialize@2.0.0","_shasum":"2004267b5c355ee6824f987d6347fda675bf0cf1","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"dist":{"shasum":"2004267b5c355ee6824f987d6347fda675bf0cf1","size":5769,"noattachment":false,"key":"/dom-serialize/-/dom-serialize-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/dom-serialize/download/dom-serialize-2.0.0.tgz"},"directories":{},"publish_time":1423022137509,"_cnpm_publish_time":1423022137509,"_hasShrinkwrap":false},"1.2.1":{"name":"dom-serialize","version":"1.2.1","description":"Serializes any DOM node into a String","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/webmodules/dom-serialize.git"},"keywords":["browser","node","dom","serialize","string"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/webmodules/dom-serialize/issues"},"homepage":"https://github.com/webmodules/dom-serialize","dependencies":{"custom-event":"~1.0.0","ent":"~2.2.0","void-elements":"~1.0.0"},"devDependencies":{"zuul":"~1.16.3"},"gitHead":"3fe1f5db80b6d674e2a132508017f4d3db63d896","_id":"dom-serialize@1.2.1","_shasum":"7c01e94a9838dd3ecec54d4a82fa4b76078a3f59","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"dist":{"shasum":"7c01e94a9838dd3ecec54d4a82fa4b76078a3f59","size":5468,"noattachment":false,"key":"/dom-serialize/-/dom-serialize-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/dom-serialize/download/dom-serialize-1.2.1.tgz"},"directories":{},"publish_time":1423008470164,"_cnpm_publish_time":1423008470164,"_hasShrinkwrap":false},"1.2.0":{"name":"dom-serialize","version":"1.2.0","description":"Serializes any DOM node into a String","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/webmodules/dom-serialize.git"},"keywords":["browser","node","dom","serialize","string"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/webmodules/dom-serialize/issues"},"homepage":"https://github.com/webmodules/dom-serialize","dependencies":{"custom-event":"~1.0.0","ent":"~2.2.0","void-elements":"~1.0.0"},"devDependencies":{"zuul":"~1.16.3"},"gitHead":"974d7fddae960b8acc26f76dbe742723d1741203","_id":"dom-serialize@1.2.0","_shasum":"e235ac523b0b41c5864fad9d6f9190384c8d9b97","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"dist":{"shasum":"e235ac523b0b41c5864fad9d6f9190384c8d9b97","size":5250,"noattachment":false,"key":"/dom-serialize/-/dom-serialize-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/dom-serialize/download/dom-serialize-1.2.0.tgz"},"directories":{},"publish_time":1422927684384,"_cnpm_publish_time":1422927684384,"_hasShrinkwrap":false},"1.1.0":{"name":"dom-serialize","version":"1.1.0","description":"Serializes any DOM node into a String","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git://github.com/webmodules/dom-serialize.git"},"keywords":["browser","node","dom","serialize","string"],"author":{"name":"Nathan Rajlich","email":"nathan@tootallnate.net","url":"http://n8.io/"},"license":"MIT","bugs":{"url":"https://github.com/webmodules/dom-serialize/issues"},"homepage":"https://github.com/webmodules/dom-serialize","dependencies":{"custom-event":"~1.0.0","ent":"~2.2.0","void-elements":"~1.0.0"},"devDependencies":{"zuul":"~1.16.3"},"gitHead":"d6584bab9a1678aac20a91373e41323fbf9ad4c4","_id":"dom-serialize@1.1.0","_shasum":"62f034f4f4aa8da42dfa508142c67de815d52bdb","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"tootallnate","email":"nathan@tootallnate.net"},"maintainers":[{"name":"tootallnate","email":"nathan@tootallnate.net"}],"dist":{"shasum":"62f034f4f4aa8da42dfa508142c67de815d52bdb","size":4509,"noattachment":false,"key":"/dom-serialize/-/dom-serialize-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/dom-serialize/download/dom-serialize-1.1.0.tgz"},"directories":{},"publish_time":1421455569519,"_cnpm_publish_time":1421455569519,"_hasShrinkwrap":false}},"readme":"dom-serialize\n=============\n### Serializes any DOM node into a String\n\n[![Sauce Test Status](https://saucelabs.com/browser-matrix/dom-serialize.svg)](https://saucelabs.com/u/dom-serialize)\n\n[![Build Status](https://travis-ci.org/webmodules/dom-serialize.svg?branch=master)](https://travis-ci.org/webmodules/dom-serialize)\n\nIt's like `outerHTML`, but it works with:\n\n * DOM elements\n * Text nodes\n * Attributes\n * Comment nodes\n * Documents\n * DocumentFragments\n * Doctypes\n * NodeLists / Arrays\n\nFor custom serialization logic, a \"serialize\" event is dispatched on\nevery `Node` which event listeners can override the default behavior on by\nsetting the `event.detail.serialize` property to a String or other Node.\n\nThe \"serialize\" event bubbles, so it could be a good idea to utilize\nevent delegation on a known root node that will be serialized.\nCheck the `event.serializeTarget` property to check which `Node` is\ncurrently being serialized.\n\n\nInstallation\n------------\n\n``` bash\n$ npm install dom-serialize\n```\n\n\nExample\n-------\n\n``` js\nvar serialize = require('dom-serialize');\nvar node;\n\n// works with Text nodes\nnode = document.createTextNode('foo & <bar>');\nconsole.log(serialize(node));\n\n\n// works with DOM elements\nnode = document.createElement('body');\nnode.appendChild(document.createElement('strong'));\nnode.firstChild.appendChild(document.createTextNode('hello'));\nconsole.log(serialize(node));\n\n\n// custom \"serialize\" event\nnode.firstChild.addEventListener('serialize', function (event) {\n  event.detail.serialize = 'pwn';\n}, false);\nconsole.log(serialize(node));\n\n\n// you can also just pass a function in for a one-time serializer\nconsole.log(serialize(node, function (event) {\n  if (event.serializeTarget === node.firstChild) {\n    // for the first child, output an ellipsis to summarize \"content\"\n    event.detail.serialze = '…';\n  } else if (event.serializeTarget !== node) {\n    // any other child\n    event.preventDefault();\n  }\n}));\n```\n\n```\nfoo &amp; &lt;bar&gt;\n<body><strong>hello</strong></body>\n<body>pwn</body>\n<body>…</body>\n```\n","_attachments":{},"homepage":"https://github.com/webmodules/dom-serialize","bugs":{"url":"https://github.com/webmodules/dom-serialize/issues"},"license":"MIT"}