{"_id":"cors-version","_rev":"4-8aa5479a11d32792c3d1c0e4923a126a","name":"cors-version","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"cors-version","version":"1.0.0","keywords":["cors","express","connect","middleware"],"author":{"url":"https://github.com/troygoode/","name":"Troy Goode","email":"troygoode@gmail.com"},"license":"MIT","_id":"cors-version@1.0.0","maintainers":[{"name":"kevonda3","email":"KevondaSolver3@hotmail.com"}],"homepage":"https://github.com/expressjs/cors#readme","bugs":{"url":"https://github.com/expressjs/cors/issues"},"dist":{"shasum":"4a43fedcd362f2e327920310d01322637c575018","tarball":"https://registry.npmjs.org/cors-version/-/cors-version-1.0.0.tgz","fileCount":3,"integrity":"sha512-zirxNbjf0MTBAXwBMdvjaW21/2Kd03KV1ICCbuKvdHHiAV6AO4WWRHnNq+M/cJKisfekHMFdVXt7+Oa/ToQgHQ==","signatures":[{"sig":"MEYCIQC5u0g5zriXxXuTHB5Q4cPt0x9JW3OQTZq5zgZSWfmAIwIhAIr6jQ5r2y4NckX+JH2iczT+2AQ6tBtqaXVDcnsvguRt","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13210},"main":"./lib/index.js","engines":{"node":">= 0.10"},"funding":{"url":"https://opencollective.com/express","type":"opencollective"},"scripts":{"lint":"eslint lib test","test":"npm run lint && npm run test-ci","test-ci":"nyc --reporter=lcov --reporter=text mocha --require test/support/env"},"_npmUser":{"name":"kevonda3","email":"KevondaSolver3@hotmail.com"},"repository":{"url":"git+https://github.com/expressjs/cors.git","type":"git"},"_npmVersion":"11.18.0","description":"Node.js CORS middleware","directories":{},"_nodeVersion":"24.18.0","dependencies":{"vary":"^1","object-assign":"^4"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/cors-version_1.0.0_1784875579946_0.5262964641137009","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"cors-version","version":"1.0.1","keywords":["cors","express","connect","middleware"],"author":{"url":"https://github.com/troygoode/","name":"Troy Goode","email":"troygoode@gmail.com"},"license":"MIT","_id":"cors-version@1.0.1","maintainers":[{"name":"kevonda3","email":"KevondaSolver3@hotmail.com"}],"homepage":"https://github.com/expressjs/cors#readme","bugs":{"url":"https://github.com/expressjs/cors/issues"},"dist":{"shasum":"294c2610d3b4a62990423858cb038c077527c782","tarball":"https://registry.npmjs.org/cors-version/-/cors-version-1.0.1.tgz","fileCount":3,"integrity":"sha512-+Eep+nF8of9DbEmGYnGSexL1L5aOmJEy+4Gfu5YYUxmhS7FM0R9paKBzmutPBMMO87Bc4JFdhV7A00s2KkGQPw==","signatures":[{"sig":"MEUCIBavmjt1jKywXvBgGqyS8VrEojat2XrskqyZkqn3vXktAiEA2tJtctW/p6jIkNchUMcFT80EMMTXLd6fpraE/YDz/1o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13210},"main":"./lib/index.js","engines":{"node":">= 0.10"},"funding":{"url":"https://opencollective.com/express","type":"opencollective"},"scripts":{"lint":"eslint lib test","test":"npm run lint && npm run test-ci","test-ci":"nyc --reporter=lcov --reporter=text mocha --require test/support/env"},"_npmUser":{"name":"kevonda3","email":"KevondaSolver3@hotmail.com"},"repository":{"url":"git+https://github.com/expressjs/cors.git","type":"git"},"_npmVersion":"11.18.0","description":"Node.js CORS middleware","directories":{},"_nodeVersion":"24.18.0","dependencies":{"vary":"^1","object-assign":"^4"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/cors-version_1.0.1_1784875667753_0.638170314736354","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"cors-version","version":"1.0.2","keywords":["svg","svg-optimizer","svg-tools","svg-sanitize","vector","node"],"author":"","license":"MIT","_id":"cors-version@1.0.2","maintainers":[{"name":"kevonda3","email":"KevondaSolver3@hotmail.com"}],"bin":{"svgcraft":"bin/svgcraft.mjs"},"dist":{"shasum":"871c54a948569e0fd01a32ecd3feac26f3323750","tarball":"https://registry.npmjs.org/cors-version/-/cors-version-1.0.2.tgz","fileCount":10,"integrity":"sha512-8xHuEh4GfA2FqcMPLBZTHEnL/0KR0X/2YcsiTzOvaJm2K9I+oYBzdyfTmL2PMD+UImgaEuBrkR1QZU5JAyoxYQ==","signatures":[{"sig":"MEQCIDjYkAa3RZgBStXd/wCAlaOtQqahOG3Qa0q0FVMl3oMWAiAhD9MZ+ZPW86DLScsrNz+jAIw16VOKvbT1rLGnAItJwA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28944},"main":"./src/index.cjs","type":"module","types":"./src/index.d.ts","module":"./src/index.mjs","engines":{"node":">=18"},"exports":{".":{"types":"./src/index.d.ts","import":"./src/index.mjs","require":"./src/index.cjs"}},"scripts":{"test":"node test/index.test.mjs","minify":"node bin/svgcraft.mjs examples/sample.svg --minify --sanitize --out examples/sample.min.svg","inspect":"node bin/svgcraft.mjs examples/sample.svg --inspect"},"_npmUser":{"name":"kevonda3","email":"KevondaSolver3@hotmail.com"},"_npmVersion":"11.18.0","description":"Professional zero-dependency SVG utilities for Node.js.","directories":{},"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/cors-version_1.0.2_1784875886163_0.9095254420919276","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"cors-version","version":"1.0.3","description":"Professional zero-dependency SVG utilities for Node.js.","type":"module","main":"./src/index.cjs","module":"./src/index.mjs","types":"./src/index.d.ts","bin":{"svgcraft":"bin/svgcraft.mjs"},"exports":{".":{"types":"./src/index.d.ts","import":"./src/index.mjs","require":"./src/index.cjs"}},"scripts":{"test":"node test/index.test.mjs","inspect":"node bin/svgcraft.mjs examples/sample.svg --inspect","minify":"node bin/svgcraft.mjs examples/sample.svg --minify --sanitize --out examples/sample.min.svg"},"keywords":["svg","svg-optimizer","svg-tools","svg-sanitize","vector","node"],"author":"","license":"MIT","engines":{"node":">=18"},"_id":"cors-version@1.0.3","_nodeVersion":"24.18.0","_npmVersion":"11.18.0","dist":{"integrity":"sha512-8N4Ojc30VGfX6aicdn0PO4t1ZlEVrWt0T5htgm76SMEkJKcj6ooonrDx3EA6KeeX2yNU29OfhsiuoBV/A5L3pg==","shasum":"440650ba2318f390a1b9ccb8aebef94d324a8c25","tarball":"https://registry.npmjs.org/cors-version/-/cors-version-1.0.3.tgz","fileCount":10,"unpackedSize":28938,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICD0hRokP9ZW7FsjO8wjrBQ693pNfIaEC4B0JdlNlLinAiAfQArejrdyF0XQgo955yLGaTNzgr97Rr6oWbTwmoznyw=="}]},"_npmUser":{"name":"kevonda3","email":"KevondaSolver3@hotmail.com"},"directories":{},"maintainers":[{"name":"kevonda3","email":"KevondaSolver3@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cors-version_1.0.3_1784876249044_0.7268796270839581"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-24T06:46:19.878Z","modified":"2026-07-24T06:57:29.319Z","1.0.0":"2026-07-24T06:46:20.083Z","1.0.1":"2026-07-24T06:47:47.886Z","1.0.2":"2026-07-24T06:51:26.303Z","1.0.3":"2026-07-24T06:57:29.176Z"},"license":"MIT","keywords":["svg","svg-optimizer","svg-tools","svg-sanitize","vector","node"],"description":"Professional zero-dependency SVG utilities for Node.js.","maintainers":[{"name":"kevonda3","email":"KevondaSolver3@hotmail.com"}],"readme":"# core-version\n\nProfessional zero-dependency SVG utilities for Node.js.\n\n`core-version` is a small npm-ready package for common SVG cleanup and transformation work. It is designed for lightweight build scripts, icon pipelines, dashboards, and internal tooling where you do not want a large dependency tree.\n\n## Features\n\n- Validate SVG strings\n- Read root SVG attributes\n- Extract width, height, viewBox, element types, and IDs\n- Remove comments, scripts, event handlers, `javascript:` links, and `foreignObject`\n- Minify SVG strings with safe whitespace cleanup\n- Replace fill or stroke colors\n- Prefix IDs and `url(#id)` references\n- Add or replace `<title>`\n- Convert SVG to and from data URI format\n- Use as ESM, CommonJS, or CLI\n- Zero dependencies\n\n## Install\n\n```bash\nnpm i core-version\n```\n\nFor local development from this folder:\n\n```bash\nnpm install\nnpm test\n```\n\n## ESM Usage\n\n```js\nimport {\n  getMetadata,\n  normalizeSvg,\n  toDataUri\n} from \"core-version\";\n\nconst svg = `\n<svg width=\"120\" height=\"80\" viewBox=\"0 0 120 80\">\n  <rect id=\"bg\" width=\"120\" height=\"80\" fill=\"red\" />\n</svg>\n`;\n\nconsole.log(getMetadata(svg));\n\nconst cleanSvg = normalizeSvg(svg, {\n  title: \"Brand Icon\",\n  prefix: \"brand\",\n  fill: \"#111827\"\n});\n\nconsole.log(toDataUri(cleanSvg));\n```\n\n## CommonJS Usage\n\n```js\nconst { sanitizeSvg, minifySvg } = require(\"core-version\");\n\nconst clean = minifySvg(sanitizeSvg(svg));\nconsole.log(clean);\n```\n\n## CLI Usage\n\n```bash\nsvgcraft logo.svg --inspect\nsvgcraft logo.svg --sanitize --minify --out logo.clean.svg\nsvgcraft icon.svg --fill \"#111827\" --prefix app --out icon.ready.svg\nsvgcraft icon.svg --data-uri\n```\n\n## API\n\n### `isSvg(input)`\n\nReturns `true` when the input is a valid SVG string containing `<svg>...</svg>`.\n\n### `getMetadata(svg)`\n\nReturns width, height, viewBox, xmlns, title/description state, element types, and length.\n\n### `sanitizeSvg(svg, options)`\n\nRemoves unsafe or noisy SVG content. Default behavior removes comments, scripts, event handlers, `javascript:` links, and `foreignObject`.\n\n```js\nsanitizeSvg(svg, {\n  removeComments: true,\n  removeScripts: true,\n  removeForeignObject: true,\n  removeEventHandlers: true,\n  removeJavascriptLinks: true\n});\n```\n\n### `minifySvg(svg, options)`\n\nRemoves comments and collapses safe whitespace.\n\n### `setColor(svg, color, options)`\n\nReplaces color attributes. By default it updates `fill` and preserves `fill=\"none\"` and `fill=\"url(#id)\"`.\n\n```js\nsetColor(svg, \"#000\", {\n  attributes: [\"fill\", \"stroke\"],\n  preserveNone: true,\n  preserveUrl: true\n});\n```\n\n### `prefixIds(svg, prefix)`\n\nPrefixes IDs and matching references.\n\n```js\nprefixIds(svg, \"brand\");\n```\n\nTurns:\n\n```xml\n<linearGradient id=\"accent\" />\n<rect fill=\"url(#accent)\" />\n```\n\nInto:\n\n```xml\n<linearGradient id=\"brand-accent\" />\n<rect fill=\"url(#brand-accent)\" />\n```\n\n### `normalizeSvg(svg, options)`\n\nOne-call production cleanup.\n\n```js\nconst output = normalizeSvg(svg, {\n  sanitize: true,\n  minify: true,\n  title: \"Company Mark\",\n  prefix: \"company\",\n  fill: \"#111827\",\n  stroke: \"#111827\"\n});\n```\n\n## Project Structure\n\n```text\ncore-version/\n  bin/svgcraft.mjs\n  src/index.mjs\n  src/index.cjs\n  src/index.d.ts\n  examples/sample.svg\n  examples/basic.mjs\n  test/index.test.mjs\n  package.json\n  README.md\n  CHANGELOG.md\n  LICENSE\n```\n\n## Notes\n\nThis package uses regex-based SVG transforms. It is excellent for common icon and asset workflows. For full XML-level editing of complex SVG documents, use a dedicated XML parser.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}