{"_id":"@aurokk/dom-to-svg","_rev":"1-cfa08e39a787557f1007f2d29428dc93","name":"@aurokk/dom-to-svg","description":"Take SVG screenshots of DOM elements","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.3":{"name":"@aurokk/dom-to-svg","version":"1.0.3","keywords":["svg","dom","screenshot","snapshot","document","element","image"],"author":{"name":"Felix Becker"},"license":"MIT","_id":"@aurokk/dom-to-svg@1.0.3","homepage":"https://github.com/aurokk/dom-to-svg#readme","bugs":{"url":"https://github.com/aurokk/dom-to-svg/issues"},"dist":{"shasum":"0eb85e6db130afaa7d9a2b4e73fe933360be1252","tarball":"https://registry.npmjs.org/@aurokk/dom-to-svg/-/dom-to-svg-1.0.3.tgz","fileCount":67,"integrity":"sha512-7pfswMhsZSizeFgiJlJpqkTZRu/xC1ailEgOimSpZ3C9NzAeyVxw5VWcjKodrBCFU9SKwoAsSiHZ+0jCabnn+Q==","signatures":[{"sig":"MEUCIQCmtc0JPkzdePelqjz96r8gegNbZDDtROciTzSE6+OxRQIgSmpUVs/C8lrPj28zOZXd4Wht+r2iPSIqFStlqaLafKQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":337236},"main":"lib/index.js","type":"module","husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"types":"./lib/index.d.ts","gitHead":"7d1f8771bd60654f124d27bb70f978d3a7caf837","release":{"branches":["main"]},"scripts":{"test":"mocha src/test/test.ts","build":"tsc -p .","watch":"tsc -p . -w","eslint":"eslint 'src/**/*.ts'","prettier":"prettier --check '**/*.{yml,ts,json}'","get-fixture":"TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node src/test/get-fixture.ts","prettier-fix":"prettier --write '**/*.{yml,ts,json}'","semantic-release":"semantic-release"},"_npmUser":{"name":"aurokk","email":"aurokkez@gmail.com"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/aurokk/dom-to-svg.git","type":"git"},"_npmVersion":"10.8.1","description":"Take SVG screenshots of DOM elements","directories":{},"sideEffects":false,"_nodeVersion":"21.7.3","browserslist":["last 2 Chrome versions","last 2 Firefox versions"],"dependencies":{"esm":"^3.2.25","postcss":"^8.3.5","gradient-parser":"^1.0.2","postcss-value-parser":"^4.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.4","rxjs":"^7.1.0","delay":"^4.4.0","husky":"^4.3.0","mocha":"^10.0.0","pngjs":"^6.0.0","eslint":"^8.57.0","chardet":"^1.3.0","globals":"^15.6.0","ts-node":"^10.0.0","prettier":"^2.2.1","lodash-es":"^4.17.21","puppeteer":"^21.0.0","@eslint/js":"^9.5.0","mime-types":"^2.1.30","pixelmatch":"^5.2.1","typescript":"^5.0.0","@types/chai":"^4.2.19","@types/node":"^14.17.4","@types/mocha":"^10.0.0","@types/pngjs":"^6.0.0","content-type":"^1.0.4","@pollyjs/core":"^5.0.0","xml-formatter":"^2.4.0","@types/type-is":"^1.6.3","parcel-bundler":"^1.12.5","@commitlint/cli":"^11.0.0","@types/prettier":"^2.2.3","@pollyjs/adapter":"^5.0.0","@types/lodash-es":"^4.17.4","semantic-release":"^24.0.0","@types/eslint__js":"^8.42.3","@types/mime-types":"^2.1.0","@types/pixelmatch":"^5.2.3","typescript-eslint":"^7.13.1","source-map-support":"^0.5.19","@types/content-type":"^1.1.3","@types/pollyjs__core":"^4.3.2","tagged-template-noop":"^2.1.1","@pollyjs/persister-fs":"^5.0.0","@types/parcel-bundler":"^1.12.3","@sourcegraph/prettierrc":"^3.0.3","@types/pollyjs__persister-fs":"^2.0.1","@commitlint/config-conventional":"^11.0.0"},"_npmOperationalInternal":{"tmp":"tmp/dom-to-svg_1.0.3_1719147316547_0.549510147904039","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"@aurokk/dom-to-svg","version":"1.0.4","description":"Take SVG screenshots of DOM elements","main":"lib/index.js","sideEffects":false,"type":"module","repository":{"type":"git","url":"git+https://github.com/aurokk/dom-to-svg.git"},"publishConfig":{"access":"public"},"browserslist":["last 2 Chrome versions","last 2 Firefox versions"],"keywords":["svg","dom","screenshot","snapshot","document","element","image"],"scripts":{"build":"tsc -p .","watch":"tsc -p . -w","eslint":"eslint 'src/**/*.ts'","prettier":"prettier --check '**/*.{yml,ts,json}'","prettier-fix":"prettier --write '**/*.{yml,ts,json}'","get-fixture":"TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node src/test/get-fixture.ts","test":"mocha src/test/test.ts","semantic-release":"semantic-release"},"commitlint":{"extends":["@commitlint/config-conventional"]},"release":{"branches":["main"]},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"author":{"name":"Felix Becker"},"license":"MIT","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@eslint/js":"^9.5.0","@pollyjs/adapter":"^5.0.0","@pollyjs/core":"^5.0.0","@pollyjs/persister-fs":"^5.0.0","@sourcegraph/prettierrc":"^3.0.3","@types/chai":"^4.2.19","@types/content-type":"^1.1.3","@types/eslint__js":"^8.42.3","@types/lodash-es":"^4.17.4","@types/mime-types":"^2.1.0","@types/mocha":"^10.0.0","@types/node":"^14.17.4","@types/parcel-bundler":"^1.12.3","@types/pixelmatch":"^5.2.3","@types/pngjs":"^6.0.0","@types/pollyjs__core":"^4.3.2","@types/pollyjs__persister-fs":"^2.0.1","@types/prettier":"^2.2.3","@types/type-is":"^1.6.3","chai":"^4.3.4","chardet":"^1.3.0","content-type":"^1.0.4","delay":"^4.4.0","eslint":"^8.57.0","globals":"^15.6.0","husky":"^4.3.0","lodash-es":"^4.17.21","mime-types":"^2.1.30","mocha":"^10.0.0","parcel-bundler":"^1.12.5","pixelmatch":"^5.2.1","pngjs":"^6.0.0","prettier":"^2.2.1","puppeteer":"^21.0.0","rxjs":"^7.1.0","semantic-release":"^24.0.0","source-map-support":"^0.5.19","tagged-template-noop":"^2.1.1","ts-node":"^10.0.0","typescript":"^5.0.0","typescript-eslint":"^7.13.1","xml-formatter":"^2.4.0"},"dependencies":{"esm":"^3.2.25","gradient-parser":"^1.0.2","postcss":"^8.3.5","postcss-value-parser":"^4.1.0"},"_id":"@aurokk/dom-to-svg@1.0.4","gitHead":"34fd10681cafcd3ccb27b2d4addaae1f70a3dc52","types":"./lib/index.d.ts","bugs":{"url":"https://github.com/aurokk/dom-to-svg/issues"},"homepage":"https://github.com/aurokk/dom-to-svg#readme","_nodeVersion":"21.7.3","_npmVersion":"10.8.1","dist":{"integrity":"sha512-SXmtOqpd8R8BE8d54XEsXMEX3t+Kw7ohm9YmwQthZoC+u0tqpBDEovLApHDe6E0FYCtFMooXdR/dygL4rbEJdA==","shasum":"3b3fbffe51148554f6c3f122e5f955b675e97542","tarball":"https://registry.npmjs.org/@aurokk/dom-to-svg/-/dom-to-svg-1.0.4.tgz","fileCount":67,"unpackedSize":348791,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDaEOSBKzLGK1k/cRN2Oy8LNGv9wGQX/JeX/JGcx+4JuQIgUpPkZr7eVrGhISVfzvun664opgoSwAbrdyCeV19mmEw="}]},"_npmUser":{"name":"aurokk","email":"aurokkez@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dom-to-svg_1.0.4_1719422304138_0.8816543534579666"},"_hasShrinkwrap":false}},"time":{"created":"2024-06-23T12:55:16.435Z","modified":"2024-06-26T17:18:24.456Z","1.0.3":"2024-06-23T12:55:16.711Z","1.0.4":"2024-06-26T17:18:24.311Z"},"maintainers":[{"name":"aurokk","email":"aurokkez@gmail.com"}],"author":{"name":"Felix Becker"},"repository":{"type":"git","url":"git+https://github.com/aurokk/dom-to-svg.git"},"keywords":["svg","dom","screenshot","snapshot","document","element","image"],"license":"MIT","homepage":"https://github.com/aurokk/dom-to-svg#readme","bugs":{"url":"https://github.com/aurokk/dom-to-svg/issues"},"readme":"# DOM to SVG\n\n![license: MIT](https://img.shields.io/npm/l/dom-to-svg)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![npm](https://img.shields.io/npm/v/@aurokk/dom-to-svg)](https://www.npmjs.com/package/@aurokk/dom-to-svg)\n\nLibrary to convert a given HTML DOM node into an accessible SVG \"screenshot\".\n\nPLEASE NOTE: IT IS A FORK OF [felixfbecker/dom-to-svg](https://github.com/felixfbecker/dom-to-svg) THAT I WANT TO ACTUALIZE AND IMPROVE. THERE IS NO TESTS AND IT IS UNSTABLE, SO DO NOT USE IT IN PRODUCTION. I WILL REMOVE THAT MESSAGE WHEN IT IS READY. THANKS.\n\n## Usage\n\n```js\nimport { documentToSVG, elementToSVG, inlineResources, formatXML } from 'dom-to-svg'\n\n// Capture the whole document\nconst svgDocument = documentToSVG(document)\n\n// Capture specific element\nconst svgDocument = elementToSVG(document.querySelector('#my-element'))\n\n// Inline external resources (fonts, images, etc) as data: URIs\nawait inlineResources(svgDocument.documentElement)\n\n// Get SVG string\nconst svgString = new XMLSerializer().serializeToString(svgDocument)\n```\n\nThe output can be used as-is as valid SVG or easily passed to other packages to pretty-print or compress.\n\n## Features\n\n- Does NOT rely on `<foreignObject>` - SVGs will work in design tools like Illustrator, Figma etc.\n- Maintains DOM accessibility tree by annotating SVG with correct ARIA attributes.\n- Maintains interactive links.\n- Maintains text to allow copying to clipboard.\n- Can inline external resources like images, fonts, etc to make SVG self-contained.\n- Maintains CSS stacking order of elements.\n- Outputs debug attributes on SVG to trace elements back to their DOM nodes.\n","readmeFilename":"README.md"}