{"name":"xml-parser-xo","version":"4.1.6","repository":{"type":"git","url":"git+https://github.com/chrisbottin/xml-parser.git"},"bugs":{"url":"https://github.com/chrisbottin/xml-parser/issues"},"homepage":"https://github.com/chrisbottin/xml-parser#readme","description":"Parse a XML string into a proprietary syntax tree","author":{"name":"Chris Bottin","email":"chrisbottin@gmail.com"},"license":"MIT","main":"./dist/cjs/index.js","es2015":"./dist/esm/index.js","types":"./dist/types/index.d.ts","sideEffects":false,"scripts":{"lint":"eslint . --ext=js,ts","clean":"rm -rf ./dist","compile":"npm run clean && npm run lint && npm run compile:commonjs && npm run compile:esnext && npm run compile:types","compile:commonjs":"tsc --module commonjs --outDir ./dist/cjs --noEmit false","compile:esnext":"tsc --module esnext --outDir ./dist/esm --noEmit false","compile:types":"tsc --emitDeclarationOnly --declaration --declarationMap --outDir ./dist/types --noEmit false","test":"mocha --require=ts-node/register --extension=js,ts --spec=test","prepublishOnly":"echo Please use publish.sh && exit 1"},"engines":{"node":">= 20"},"keywords":["xml","parse","parser","convert","converter","syntax","tree"],"devDependencies":{"@types/chai":"^4.3.3","@types/mocha":"^7.0.2","@types/node":"^14.18.29","@typescript-eslint/eslint-plugin":"^8.0.0","@typescript-eslint/parser":"^8.0.0","@eslint/js":"^10.0.0","chai":"^4.3.4","eslint":"^10.0.0","globals":"^15.0.0","mocha":"^10.2.0","ts-node":"^10.9.1","typescript":"^4.8.3"},"gitHead":"c3d574031710f86ad11d0e16b13d52f9b8a52d3d","_id":"xml-parser-xo@4.1.6","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-mXbSNSM+rIwndoxSwmFa83bOdeP8G/cOGr7XvxA67X7ebCzoAuVez9JYDCDub3zRDNBZxIbfjuXLSsamr7NfwQ==","shasum":"22bb2d0e1f651f92de04c7b79433a9df6f1490f2","tarball":"http://registry-npm.ywwl.com/xml-parser-xo/download/xml-parser-xo-4.1.6.tgz","fileCount":10,"unpackedSize":43106,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/xml-parser-xo@4.1.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCwfeTCxeFhq/vMDGWDfZPIUkrFxS4tor/jw+OpC27c5AIhAOdeEI6CG6R5lizyOc7BQ/cg1M0Tl5tQWf7jF0xwSw3S"}],"size":8126,"noattachment":false,"key":"/xml-parser-xo/-/xml-parser-xo-4.1.6.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:7b28068b-3737-461a-8862-d069e148e849"}},"directories":{},"maintainers":[{"name":"chrisbottin","email":"chrisbottin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/xml-parser-xo_4.1.6_1779397540330_0.7285478675391353"},"_hasShrinkwrap":false,"readme":"\n# xml-parser-xo\n\nAn XML parser based on [xml-parser](https://www.npmjs.com/package/xml-parser).\n\n[![Build Status](https://github.com/chrisbottin/xml-parser/actions/workflows/ci.yml/badge.svg)](https://github.com/chrisbottin/xml-parser/actions/workflows/ci.yml) [![npm version](https://img.shields.io/npm/v/xml-parser-xo.svg)](https://npmjs.org/package/xml-parser-xo)\n\n## Installation\n\n```\n$ npm install xml-parser-xo\n```\n\n## Example\n\n### Usage:\n\n```js\nimport xmlParser from 'xml-parser-xo';\n\nvar xml = `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Load the stylesheet -->\n<?xml-stylesheet href=\"foo.xsl\" type=\"text/xsl\" ?>\n<!DOCTYPE foo SYSTEM \"foo.dtd\">\n<foo><![CDATA[some text]]> content</foo>`;\n\nxmlParser(xml);\n```\n\n### Output:\n\n```json\n{\n    \"declaration\": {\n        \"type\": \"ProcessingInstruction\",\n        \"attributes\": {\"version\": \"1.0\", \"encoding\": \"utf-8\"}\n    },\n    \"root\": {\n        \"type\": \"Element\",\n        \"name\": \"foo\",\n        \"attributes\": {},\n        \"children\": [\n            {\"type\": \"CDATA\", \"content\": \"<![CDATA[some text]]>\"},\n            {\"type\": \"Text\", \"content\": \" content\"}\n        ]\n    },\n    \"children\": [\n        {\"type\": \"Comment\", \"content\": \"<!-- Load the stylesheet -->\"},\n        {\"type\": \"ProcessingInstruction\", \"attributes\": {\"href\": \"foo.xsl\", \"type\": \"text/xsl\"}},\n        {\"type\": \"DocumentType\", \"content\": \"<!DOCTYPE foo SYSTEM \\\"foo.dtd\\\">\"},\n        {\n            \"type\": \"Element\",\n            \"name\": \"foo\",\n            \"attributes\": {},\n            \"children\": [\n                {\"type\": \"CDATA\", \"content\": \"<![CDATA[some text]]>\"},\n                {\"type\": \"Text\", \"content\": \" content\"}\n            ]\n        }\n    ]\n}\n```\n\n## Options\n\n- `filter`: Function to filter out unwanted nodes by returning `false`.\n  - type: `function(node) => boolean`\n  - default: `() => true`\n- `strictMode`: True to throw an error when parsing XML document with invalid content like mismatched closing tags.\n  - type: `boolean`\n  - default: `false`\n\n### Usage:\n\n```js\nimport xmlParser from 'xml-parser-xo';\n\nconst xml = `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Load the stylesheet -->\n<?xml-stylesheet href=\"foo.xsl\" type=\"text/xsl\" ?>\n<!DOCTYPE foo SYSTEM \"foo.dtd\">\n<foo><![CDATA[some text]]> content</foo>`;\n\nxmlParser(xml, {\n    filter: (node) => {\n        return node.type === 'Element' || node.type === 'Text';\n    }\n});\n```\n\n### Output:\n\n```json\n{\n    \"declaration\": {\n        \"type\": \"ProcessingInstruction\",\n        \"attributes\": {\"version\": \"1.0\", \"encoding\": \"utf-8\"}\n    },\n    \"root\": {\n        \"type\": \"Element\",\n        \"name\": \"foo\",\n        \"attributes\": {},\n        \"children\": [\n            {\"type\": \"Text\", \"content\": \" content\"}\n        ]\n    },\n    \"children\": [\n        {\n            \"type\": \"Element\",\n            \"name\": \"foo\",\n            \"attributes\": {},\n            \"children\": [\n                {\"type\": \"Text\", \"content\": \" content\"}\n            ]\n        }\n    ]\n}\n```\n\n## License\n\nMIT\n","publish_time":1779397540461,"_cnpm_publish_time":1779397540461,"dist-tags":{"latest":"4.1.6"}}