{"_id":"xml-stream","_rev":"38-0b63850c4a5675d6d276daa094d210ed","name":"xml-stream","dist-tags":{"latest":"0.4.5"},"versions":{"0.2.0":{"name":"xml-stream","version":"0.2.0","keywords":["xml","parser","expat"],"author":{"name":"AssistUnion","email":"info@assistunion.com"},"_id":"xml-stream@0.2.0","maintainers":[{"name":"Anatoly Ressin","email":"aarnow@gmail.com"},{"url":"http://100-hour.com","name":"Dimitry Solovyov","email":"dimituri@gmail.com"}],"dist":{"shasum":"71192e76f477e5ce8bf43402550e75e8a52709af","tarball":"https://registry.npmjs.org/xml-stream/-/xml-stream-0.2.0.tgz","integrity":"sha512-0xzP2D+uREMzJ4WylBZSJKTS7PMikfPldphTsFuHb/PBQeS8X+1H8jFXj1Zto14fxU0ldyQfegogk5GMNgaD1A==","signatures":[{"sig":"MEUCIGh5k2C0/An2YIzx0OdJCmkvnRtOKt67hUrDb1pGU7wpAiEAkfm+u5q2IbPp0lfN0SjwjwbBEP81dSn61Cn/wkcAO6s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index","engines":{"node":">=0.4.7"},"scripts":{},"repository":{"url":"git://github.com/assistunion/xml-stream.git","type":"git"},"_npmVersion":"1.0.7","description":"XML stream to JavaScript object converter based on Expat.","directories":{"lib":"./lib"},"_nodeVersion":"v0.4.7","dependencies":{"node-expat":"~1.3.1"},"_defaultsLoaded":true,"devDependencies":{"vows":"~0.5.8"},"_engineSupported":true},"0.3.0":{"name":"xml-stream","version":"0.3.0","keywords":["xml","parser","expat"],"author":{"name":"AssistUnion","email":"info@assistunion.com"},"_id":"xml-stream@0.3.0","maintainers":[{"name":"dimituri","email":"dimituri@gmail.com"}],"dist":{"shasum":"54cd2ca30b7bf527b4a74a9a0c5c641964c0f606","tarball":"https://registry.npmjs.org/xml-stream/-/xml-stream-0.3.0.tgz","integrity":"sha512-5ELfAzaiX/oisnusj87cLlzXcryAlZzv5BndYBZilVMZz9O0iFGKgRLSyF66pWxN0F0cA6LD+evsjgVn86EG5w==","signatures":[{"sig":"MEUCIA4R/3bWqWiY10OWYHUuEAM+bXhkWdEz8oY1uEuoTf6AAiEAxAHSZhxxvi2lcAhM2Sd/iRip8pxRJ8+FlEFCnXEsFZI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index","engines":{"node":">=0.4.7"},"repository":{"url":"git://github.com/assistunion/xml-stream.git","type":"git"},"_npmVersion":"1.0.27","description":"XML stream to JavaScript object converter based on Expat.","directories":{"lib":"./lib"},"_nodeVersion":"v0.4.10","_npmJsonOpts":{"file":"/Users/Home/.npm/xml-stream/0.3.0/package/package.json","wscript":false,"serverjs":false,"contributors":false},"dependencies":{"node-expat":"~1.3.1"},"_defaultsLoaded":true,"devDependencies":{},"_engineSupported":true},"0.3.1":{"name":"xml-stream","version":"0.3.1","keywords":["xml","parser","expat"],"author":{"name":"AssistUnion","email":"info@assistunion.com"},"_id":"xml-stream@0.3.1","maintainers":[{"name":"dimituri","email":"dimituri@gmail.com"}],"dist":{"shasum":"4bdf334ee06963dcb2aa908579a7707625191000","tarball":"https://registry.npmjs.org/xml-stream/-/xml-stream-0.3.1.tgz","integrity":"sha512-OXl6ljLD34jx/M/QsCqanZ22TqynLzjWXonDhfwdYXvUjuk5+Fu60sX8taI7G12gMtYGNEjyGg5Lu/U5+PMN8w==","signatures":[{"sig":"MEUCIBM1iPItGMrxwCxE6KmlmcPz+KDnOvE6mz38eKhNYT4VAiEAsQErB5JqfcUlO3MArNAwH95urIHMlGS1XqprBPvoJxY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index","engines":{"node":">=0.4.7"},"repository":{"url":"git://github.com/assistunion/xml-stream.git","type":"git"},"_npmVersion":"1.0.27","description":"XML stream to JavaScript object converter based on Expat.","directories":{"lib":"./lib"},"_nodeVersion":"v0.4.10","_npmJsonOpts":{"file":"/Users/Home/.npm/xml-stream/0.3.1/package/package.json","wscript":false,"serverjs":false,"contributors":false},"dependencies":{"node-expat":"~1.3.1"},"_defaultsLoaded":true,"devDependencies":{},"_engineSupported":true},"0.3.2":{"name":"xml-stream","version":"0.3.2","keywords":["xml","parser","expat"],"author":{"name":"AssistUnion","email":"info@assistunion.com"},"_id":"xml-stream@0.3.2","maintainers":[{"name":"dimituri","email":"dimituri@gmail.com"}],"dist":{"shasum":"264519a6b5572bc1d4fafdee2eac4ccf76a24adb","tarball":"https://registry.npmjs.org/xml-stream/-/xml-stream-0.3.2.tgz","integrity":"sha512-0SYdGFY3j0Sm2ZIrapYu50GYWVpUjUz6CQNUOPc4tXJt6OavS8VDOig6tZFpoXmSxDFRbfK/vz9kpwstzcDQ0A==","signatures":[{"sig":"MEYCIQCJp3TQHJrqUlmdN52S9AYJvhV3sgkcHzHBz30ptkW9IAIhAIPQ6kl6zJdOtN76yS+qJAEIBrcuPH69km7uP1ytVq/g","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index","engines":{"node":">=0.4.7"},"repository":{"url":"git://github.com/assistunion/xml-stream.git","type":"git"},"_npmVersion":"1.0.27","description":"XML stream to JavaScript object converter based on Expat.","directories":{"lib":"./lib"},"_nodeVersion":"v0.4.10","_npmJsonOpts":{"file":"/Users/Home/.npm/xml-stream/0.3.2/package/package.json","wscript":false,"serverjs":false,"contributors":false},"dependencies":{"node-expat":"~1.3.1"},"_defaultsLoaded":true,"devDependencies":{},"_engineSupported":true},"0.3.3":{"name":"xml-stream","version":"0.3.3","keywords":["xml","parser","expat"],"author":{"name":"AssistUnion","email":"info@assistunion.com"},"_id":"xml-stream@0.3.3","maintainers":[{"name":"dimituri","email":"dimituri@gmail.com"}],"dist":{"shasum":"b0b4e82272bdbe108cb4bef881b1d4328ed2ea84","tarball":"https://registry.npmjs.org/xml-stream/-/xml-stream-0.3.3.tgz","integrity":"sha512-Xu1S1vq8tHG+PpcngkbnUEo0Qx2RvrWdqmRrZtXhHai+NX/ZQ/DV5/TZc33+C1OeV0QzaDlKIUtIYLiK2OqTlA==","signatures":[{"sig":"MEYCIQCOU3ZSqzUq1210ixJ0CqmOHoNSC9bpXgGwe5qKAv99BAIhAPfXLu5eLeO3cSuvGuqAWLjqPoH5ZZ6LsyVoVPwxkg/c","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index","engines":{"node":">=0.4.7"},"_npmUser":{"name":"dimituri","email":"dimituri@gmail.com"},"repository":{"url":"git://github.com/assistunion/xml-stream.git","type":"git"},"_npmVersion":"1.0.95","description":"XML stream to JavaScript object converter based on Expat.","directories":{"lib":"./lib"},"_nodeVersion":"v0.4.12","dependencies":{"node-expat":"~1.3.1"},"_defaultsLoaded":true,"devDependencies":{},"_engineSupported":true},"0.3.4":{"name":"xml-stream","version":"0.3.4","keywords":["xml","parser","expat"],"author":{"name":"AssistUnion","email":"info@assistunion.com"},"_id":"xml-stream@0.3.4","maintainers":[{"name":"dimituri","email":"dimituri@gmail.com"}],"dist":{"shasum":"73995da037d83172c43009b90c2af14ee7d65f76","tarball":"https://registry.npmjs.org/xml-stream/-/xml-stream-0.3.4.tgz","integrity":"sha512-93mLJqIYZudxSLMXcFqPs6q/WwpxQwivJYTWZl6zrh/7rh9GbNpUCXeQF6fot4pferl74SVB3e8yR9POONrOgQ==","signatures":[{"sig":"MEUCIGvrh55yg/1dO0eviyHxVezjEIMTs0vrdTundsf5L2aCAiEA9WLvnsTpGB9gartoPTU7QXz2Msqdj+yVR0m+wnBKCbI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index","engines":{"node":">=0.4.7"},"_npmUser":{"name":"dimituri","email":"dimituri@gmail.com"},"repository":{"url":"git://github.com/assistunion/xml-stream.git","type":"git"},"_npmVersion":"1.0.95","description":"XML stream to JavaScript object converter based on Expat.","directories":{"lib":"./lib"},"_nodeVersion":"v0.4.12","dependencies":{"node-expat":"~1.3.1"},"_defaultsLoaded":true,"devDependencies":{},"_engineSupported":true},"0.4.0":{"name":"xml-stream","version":"0.4.0","keywords":["xml","parser","expat"],"author":{"name":"AssistUnion","email":"info@assistunion.com"},"_id":"xml-stream@0.4.0","maintainers":[{"name":"dimituri","email":"dimituri@gmail.com"}],"dist":{"shasum":"2e00adc594c794d15e45edcc87f02c2528628240","tarball":"https://registry.npmjs.org/xml-stream/-/xml-stream-0.4.0.tgz","integrity":"sha512-g5tiqx03eAXoahmXNANjkRChILdGyBbp2e6Z3kXqOTdfoC024AF2kuS27lWfHkc0zrz7iWE+w1sO8CCTGqK8Vw==","signatures":[{"sig":"MEUCIQD+kMQb8F3REl+IGPs0ZvzVPZiQ5dYd0At3zkSZ+6FmnAIgS7k/QNY8pOCbzHJZIcmdTVHowIx0Xedal0KScE9ilbc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index","engines":{"node":">=0.4.7"},"_npmUser":{"name":"dimituri","email":"dimituri@gmail.com"},"repository":{"url":"git://github.com/assistunion/xml-stream.git","type":"git"},"_npmVersion":"1.0.105","description":"XML stream to JavaScript object converter based on Expat.","directories":{"lib":"./lib"},"_nodeVersion":"v0.4.12","dependencies":{"iconv":"~1.1.2","node-expat":"~1.3.1"},"_defaultsLoaded":true,"devDependencies":{},"_engineSupported":true},"0.4.1":{"name":"xml-stream","version":"0.4.1","keywords":["xml","parser","expat"],"author":{"name":"AssistUnion","email":"info@assistunion.com"},"_id":"xml-stream@0.4.1","maintainers":[{"name":"dimituri","email":"dimituri@gmail.com"}],"dist":{"shasum":"cf0b0978b641ebcebd01221972b1aff6608e0901","tarball":"https://registry.npmjs.org/xml-stream/-/xml-stream-0.4.1.tgz","integrity":"sha512-E3RLJbHWsCTWNvrfwVd012ZHVD+dnh+6TV4wzzYZuZuEAmvG77mIp89eskxI4XqgUcxH7dj9mDOTDpkhREJP6Q==","signatures":[{"sig":"MEUCIGZjk0dc413byNFuhW94h5dmVvLrJjhg1+VUi29rnPYeAiEAjKB605hvSqdvl6uFvC1mWi8YR0xuIZ09hgFCP7S2zqA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index","engines":{"node":">=0.6.0"},"_npmUser":{"name":"dimituri","email":"dimituri@gmail.com"},"repository":{"url":"git://github.com/assistunion/xml-stream.git","type":"git"},"_npmVersion":"1.0.106","description":"XML stream to JavaScript object converter based on Expat.","directories":{"lib":"./lib"},"_nodeVersion":"v0.4.10","dependencies":{"iconv":"~1.1.3","node-expat":"~1.4.3"},"_defaultsLoaded":true,"devDependencies":{},"_engineSupported":false},"0.4.3":{"name":"xml-stream","version":"0.4.3","keywords":["xml","parser","expat"],"author":{"name":"AssistUnion","email":"info@assistunion.com"},"_id":"xml-stream@0.4.3","maintainers":[{"name":"dimituri","email":"dimituri@gmail.com"},{"name":"artazor","email":"anatoly@assistunion.com"}],"bugs":{"url":"https://github.com/assistunion/xml-stream/issues"},"dist":{"shasum":"a199f72613aaffa9b05d66a6e05f10290d132039","tarball":"https://registry.npmjs.org/xml-stream/-/xml-stream-0.4.3.tgz","integrity":"sha512-jc6Fhhvmhq2Svhs7CVGkobjIj9LYasfcKYnw7+xd2t63zWVHKU3DE8AQU24dEC5/f7GYUFhxMubxI7da7YB5Xg==","signatures":[{"sig":"MEUCIBD0KG8fu2IKrLl3LQkuyATInNhy98wSa9lLRar8A5AzAiEAy1EhiEjtQj3ljgzuMZaHvRpROnw8sjNysi43BY+vVVs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index","_from":".","_npmUser":{"name":"artazor","email":"anatoly@assistunion.com"},"repository":{"url":"git://github.com/assistunion/xml-stream.git","type":"git"},"_npmVersion":"1.3.2","description":"XML stream to JavaScript object converter based on Expat.","directories":{"lib":"./lib"},"dependencies":{"iconv":"~2.0.0","node-expat":"~2.0.0"}},"0.4.4":{"name":"xml-stream","version":"0.4.4","keywords":["xml","parser","expat"],"author":{"name":"AssistUnion","email":"info@assistunion.com"},"_id":"xml-stream@0.4.4","maintainers":[{"name":"dimituri","email":"dimituri@gmail.com"},{"name":"artazor","email":"anatoly@assistunion.com"}],"homepage":"https://github.com/assistunion/xml-stream","bugs":{"url":"https://github.com/assistunion/xml-stream/issues"},"dist":{"shasum":"baa558a439037762cf1452a2f84ffded5c7f4316","tarball":"https://registry.npmjs.org/xml-stream/-/xml-stream-0.4.4.tgz","integrity":"sha512-LR8e0C8aX5qsq3gaqxD/2BKU9ZH5JO/kIPg7zxmZUfnbu/CYha7RvSJju3n9+dR38FYMZlcaGeGQM3BzUAnBuA==","signatures":[{"sig":"MEYCIQC3XJeFYnTe6+FfhD1eQDxKWOfyKlVx4TRaIyuw+cElugIhALeMYzsOfQzsL3aBtt+dccqjoHR8iJfjS6jm35/27IJe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index","_from":".","_npmUser":{"name":"artazor","email":"anatoly@assistunion.com"},"repository":{"url":"git://github.com/assistunion/xml-stream.git","type":"git"},"_npmVersion":"1.3.14","description":"XML stream to JavaScript object converter based on Expat.","directories":{"lib":"./lib"},"dependencies":{"iconv":"~2.0.0","node-expat":"~2.0.0"}},"0.4.5":{"name":"xml-stream","version":"0.4.5","keywords":["xml","parser","expat"],"author":{"name":"AssistUnion","email":"info@assistunion.com"},"_id":"xml-stream@0.4.5","maintainers":[{"name":"dimituri","email":"dimituri@gmail.com"},{"name":"artazor","email":"anatoly@assistunion.com"}],"homepage":"https://github.com/assistunion/xml-stream","bugs":{"url":"https://github.com/assistunion/xml-stream/issues"},"dist":{"shasum":"7452d85b37f9b881a70eff0cf74a0df02088edeb","tarball":"https://registry.npmjs.org/xml-stream/-/xml-stream-0.4.5.tgz","integrity":"sha512-WdMVMiYgJ2UQO2vs8CRVOd0CD0GW3AfeWHwpFJWB+bRYbnNNn88BxoYbjm0qRijceJgP1krCRwr6DgfbQKudmA==","signatures":[{"sig":"MEYCIQDhnlShkSvtZUwCVUXopb/UUC6++xSmrI5haMRHW0ogIQIhALNb46+iNYPFrezhtREDdzSIFlVKs04GwPrcGDjRqAhF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index","_from":".","_shasum":"7452d85b37f9b881a70eff0cf74a0df02088edeb","gitHead":"b7ba51aacc6a5ee696bc9eed73d2c02ac14eac6d","scripts":{"test":"mocha tests"},"_npmUser":{"name":"artazor","email":"anatoly@assistunion.com"},"repository":{"url":"git://github.com/assistunion/xml-stream.git","type":"git"},"_npmVersion":"2.0.0","description":"XML stream to JavaScript object converter based on Expat.","directories":{"lib":"./lib"},"dependencies":{"iconv":"^2.1.4","node-expat":"^2.3.1","readable-stream":"^1.0.31"},"devDependencies":{"mocha":"^1.21.4"}}},"time":{"created":"2011-06-21T05:10:19.341Z","modified":"2024-11-04T19:13:50.561Z","0.2.0":"2011-06-21T05:10:20.087Z","0.3.0":"2011-09-21T05:03:08.770Z","0.3.1":"2011-09-21T12:01:07.062Z","0.3.2":"2011-09-23T02:27:07.933Z","0.3.3":"2011-10-19T01:33:48.810Z","0.3.4":"2011-11-07T15:24:21.165Z","0.4.0":"2011-11-10T15:10:54.754Z","0.4.1":"2012-02-16T10:43:05.562Z","0.4.3":"2013-08-17T13:57:24.853Z","0.4.4":"2014-01-31T09:54:58.115Z","0.4.5":"2014-10-05T07:45:26.185Z"},"bugs":{"url":"https://github.com/assistunion/xml-stream/issues"},"author":{"name":"AssistUnion","email":"info@assistunion.com"},"homepage":"https://github.com/assistunion/xml-stream","keywords":["xml","parser","expat"],"repository":{"url":"git://github.com/assistunion/xml-stream.git","type":"git"},"description":"XML stream to JavaScript object converter based on Expat.","maintainers":[{"name":"dimituri","email":"dimituri@gmail.com"},{"name":"artazor","email":"anatoly@assistunion.com"}],"readme":"# XmlStream\n\nXmlStream is a Node.js XML stream parser and editor, based on\n[node-expat](https://github.com/astro/node-expat) (libexpat SAX-like parser\nbinding).\n\n    $ npm install xml-stream\n\n## Rationale\n\nWhen working with large XML files, it is probably a bad idea to use an XML to\nJavaScript object converter, or simply buffer the whole document in memory.\nThen again, a typical SAX parser might be too low-level for some tasks (and\noften a real pain).\n\nThis is why we've rolled our own stream parser that tries to address these\nshortcomings. It processes an XML stream chunk by chunk and fires events only\nfor nodes of interest, matching them with CSS-like selectors.\n\n## Events\n\nSupported events:\n\n* `data` on outgoing data chunk,\n* `end` when parsing has ended,\n* `startElement[: selector]` on opening tag for selector match,\n* `updateElement[: selector]` on finished node for selector match\n  with its contents buffered,\n* `endElement[: selector]` on closing tag for selector match,\n* `text[: selector]` on tag text for selector match.\n\nWhen adding listeners for `startElement`, `updateElement`, and `text` the\ncallback can modify the provided node, before it is sent to the consumer.\n\nSelector syntax is CSS-like and currently supports:\n\n* `ancestor descendant`\n* `parent > child`\n\nTake a look at the examples for more information.\n\n## Element Node\n\nEach of the four node events has a callback with one argument. When parsing,\nthis argument is set to the current matched node. Having a chunk of XML like\nthis:\n\n```xml\n<item id=\"123\" type=\"common\">\n  <title>Item Title</title>\n  <description>Description of this item.</description>\n  (text)\n</item>\n```\n\nThe structure of the **item** element node would be:\n\n```javascript\n{\n  title: 'Item Title',\n  description: 'Description of this item.',\n  '$': {\n    'id': '123',\n    'type': 'common'\n  },\n  '$name': 'item',\n  '$text': '(text)'\n}\n```\n\nNaturally, element text and child elements wouldn't be known until discovered\nin the stream, so the structure may differ across events. The complete\nstructure as displayed should be available on **updateElement**. The **$name**\nis not available on **endElement**.\n\n# Collecting Children\n\nIt is sometimes required to select elements that have many children with\none and the same name. Like this XML:\n\n```xml\n<item id=\"1\">\n  <subitem>one</subitem>\n  <subitem>two</subitem>\n</item>\n<item id=\"2\">\n  <subitem>three</subitem>\n  <subitem>four</subitem>\n  <subitem>five</subitem>\n</item>\n```\n\nBy default, parsed element node contains children as properties. In the case\nof several children with same names, the last one would overwrite others.\nTo collect all of *subitem* elements in an array use **collect**:\n\n```javascript\nxml.collect('subitem');\nxml.on('endElement: item', function(item) {\n  console.log(item);\n})\n```\n\n# Preserving Elements and Text\n\nBy default, element text is returned as one concatenated string. In this XML:\n\n```xml\n<item>\n  one <a>1</b>\n  two <a>2</b>\n</item>\n```\n\nThe value of **$text** for *item* would be: `one 1 two 2` without any\nindication of the order of element *a*, element *b*, and text parts.\nTo preserve this order:\n\n```javascript\nxml.preserve('item');\nxml.on('endElement: item', function(item) {\n  console.log(item);\n})\n```\n\n# Pause and resume parsing\n\nIf you want parsing to pause (for example, until some asynchronous operation \nof yours is finished), you can pause and resume XML parsing:\n```javascript\nxml.pause();\nmyAsyncFunction( function() {\n  xml.resume();\n});\n```\nBeware that resume() **must not** be called from within a handler callback.\n\n","readmeFilename":"README.md","users":{"wmakeev":true,"kaorun343":true,"paul-byford":true,"shanewholloway":true}}