{"_id":"react-hot-svg","_rev":"2-e798db39ad9c8a377e94c65ac38eb0a5","name":"react-hot-svg","dist-tags":{"latest":"1.1.5"},"versions":{"1.1.4":{"name":"react-hot-svg","version":"1.1.4","keywords":["react","hot","svg","icon","cdn","icon-library","frontend","ui","svgo","asset-management"],"author":{"name":"copperadev"},"license":"ISC","_id":"react-hot-svg@1.1.4","maintainers":[{"name":"decentra-rich","email":"businesswork1365@outlook.com"}],"dist":{"shasum":"6c7f094ac9edaa3358b68102040e3d399b6a7d80","tarball":"https://registry.npmjs.org/react-hot-svg/-/react-hot-svg-1.1.4.tgz","fileCount":4,"integrity":"sha512-7Y2dx0Vw6HkUY3XbUY2/D21ajDyve4+T6Jd1MHrg2giz/GZsqIRPPD9dExut62awSpwaker+qiBih2lvQCyKfw==","signatures":[{"sig":"MEQCIDmL214gMcbJEuxvyDmXTVyQC3gjxIbiksQM/cMK57mvAiBQyB2UOnLuMefNi384mvK7ulQG2hkQvr3OG/8qPJtfKg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15609},"main":"index.js","types":"index.d.ts","engines":{"node":">=14"},"scripts":{"lint":"echo \"No linting configured\"","test":"echo \"No test suite configured yet\" && exit 0"},"_npmUser":{"name":"decentra-rich","email":"businesswork1365@outlook.com"},"_npmVersion":"10.9.8","description":"A lightweight React utility for fetching, validating, and managing SVG icons from CDN sources.","directories":{},"_nodeVersion":"22.23.1","dependencies":{"svgo":"^2.8.0","request":"^2.88.2"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/react-hot-svg_1.1.4_1783707695268_0.6485842554187826","host":"s3://npm-registry-packages-npm-production"}},"1.1.5":{"name":"react-hot-svg","version":"1.1.5","description":"A lightweight React utility for fetching, validating, and managing SVG icons from CDN sources.","main":"index.js","types":"index.d.ts","scripts":{"test":"echo \"No test suite configured yet\" && exit 0","lint":"echo \"No linting configured\""},"keywords":["react","hot","svg","icon","cdn","icon-library","frontend","ui","svgo","asset-management"],"engines":{"node":">=14"},"author":{"name":"copperadev"},"license":"ISC","dependencies":{"request":"^2.88.2","svgo":"^2.8.0"},"_id":"react-hot-svg@1.1.5","_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-OlaXcnyeiAXYgZdj1SEXhjV5YnL0UTWICbfPziWx50687JxIhM2IbXqw9FxQboZ8gLjaAZd4Q7co+jeqvsqHYA==","shasum":"c7b3985d9225728445abec3e521f3a8fcbebe0e0","tarball":"https://registry.npmjs.org/react-hot-svg/-/react-hot-svg-1.1.5.tgz","fileCount":4,"unpackedSize":15606,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGIVA6pygNpGApB8qhj5XEYZNOzqxp2lOo5uw42k+2MIAiBjFsrYZVcT5BEjLwzYWMkukhBWjwYll5Kjn7lQdE91/g=="}]},"_npmUser":{"name":"decentra-rich","email":"businesswork1365@outlook.com"},"directories":{},"maintainers":[{"name":"decentra-rich","email":"businesswork1365@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-hot-svg_1.1.5_1783788643554_0.516380419644066"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-10T18:21:35.198Z","modified":"2026-07-11T16:50:43.774Z","1.1.4":"2026-07-10T18:21:35.442Z","1.1.5":"2026-07-11T16:50:43.685Z"},"author":{"name":"copperadev"},"license":"ISC","keywords":["react","hot","svg","icon","cdn","icon-library","frontend","ui","svgo","asset-management"],"description":"A lightweight React utility for fetching, validating, and managing SVG icons from CDN sources.","maintainers":[{"name":"decentra-rich","email":"businesswork1365@outlook.com"}],"readme":"# react-hot-svg\r\n\r\nA lightweight, production-ready Node.js and React utility for retrieving SVG assets, JSON resources, and plugin modules from globally distributed CDN providers.\r\n\r\nDesigned for modern React applications, server-side rendering environments, build pipelines, CI/CD workflows, and Node-based asset processing systems.\r\n\r\n---\r\n\r\n## Features\r\n\r\n- Multi-CDN provider support\r\n- SVG, JSON, and static asset retrieval\r\n- Recursive SVG discovery\r\n- Plugin-based processing pipelines\r\n- Asynchronous, non-blocking operations\r\n- Compatible with React, Node.js, SSR, and build tooling\r\n\r\n---\r\n\r\n## Supported CDN Providers\r\n\r\n- Cloudflare\r\n- Fastly\r\n- Akamai\r\n- Amazon CloudFront\r\n- KeyCDN\r\n- Gcore\r\n\r\n---\r\n\r\n## Installation\r\n\r\n### npm\r\n\r\n```bash\r\nnpm install react-hot-svg\r\n```\r\n\r\n### yarn\r\n\r\n```bash\r\nyarn add react-hot-svg\r\n```\r\n\r\n### pnpm\r\n\r\n```bash\r\npnpm add react-hot-svg\r\n```\r\n\r\n---\r\n\r\n## Requirements\r\n\r\n- Node.js >= 16\r\n- npm >= 8\r\n\r\n---\r\n\r\n## Quick Start\r\n\r\n### Import\r\n\r\n```javascript\r\nconst {\r\n  setDefaultModule,\r\n  getPlugin,\r\n  setPlugin\r\n} = require(\"react-hot-svg\");\r\n```\r\n\r\n---\r\n\r\n## Fetch Assets From CDN\r\n\r\nUse `setDefaultModule()` to fetch SVG assets, JSON files, or remote resources.\r\n\r\n```javascript\r\nconst { setDefaultModule } = require(\"react-hot-svg\");\r\n\r\nasync function fetchIcons() {\r\n  try {\r\n    const data = await setDefaultModule(\r\n      \"cloudflare\",\r\n      \"svg\",\r\n      \"github.svg\"\r\n    );\r\n\r\n    console.log(data);\r\n\r\n  } catch (error) {\r\n    console.error(error);\r\n  }\r\n}\r\n\r\nfetchIcons();\r\n```\r\n\r\n---\r\n\r\n## Scan Local SVG Files\r\n\r\nUse `getPlugin()` to recursively scan directories for `.svg` files and apply the primary plugin workflow.\r\n\r\n```javascript\r\nconst { getPlugin } = require(\"react-hot-svg\");\r\n\r\ngetPlugin(\"./assets\");\r\n```\r\n\r\n---\r\n\r\n## Alternate Plugin Pipeline\r\n\r\nUse `setPlugin()` to execute the secondary SVG plugin workflow.\r\n\r\n```javascript\r\nconst { setPlugin } = require(\"react-hot-svg\");\r\n\r\nsetPlugin(\"./assets\");\r\n```\r\n\r\n---\r\n\r\n## API Reference\r\n\r\n---\r\n\r\n### setDefaultModule(provider, resourceType, token, baseUrl)\r\n\r\nFetches a resource from a selected CDN provider.\r\n\r\n#### Parameters\r\n\r\n| Parameter | Type | Description |\r\n|-----------|------|-------------|\r\n| provider | string | CDN provider name |\r\n| resourceType | string | Resource type |\r\n| token | string | Asset filename |\r\n| baseUrl | string | Optional URL override |\r\n\r\n#### Returns\r\n\r\n```javascript\r\nPromise<any>\r\n```\r\n\r\n---\r\n\r\n### getPlugin(directory)\r\n\r\nRecursively scans a directory for SVG files and executes the primary plugin pipeline.\r\n\r\n#### Parameters\r\n\r\n| Parameter | Type | Default |\r\n|-----------|------|---------|\r\n| directory | string | ./script |\r\n\r\n#### Returns\r\n\r\n```javascript\r\nvoid\r\n```\r\n\r\n---\r\n\r\n### setPlugin(directory)\r\n\r\nRecursively scans a directory for SVG files and executes the secondary plugin pipeline.\r\n\r\n#### Parameters\r\n\r\n| Parameter | Type | Default |\r\n|-----------|------|---------|\r\n| directory | string | ./script |\r\n\r\n#### Returns\r\n\r\n```javascript\r\nvoid\r\n```\r\n\r\n---\r\n\r\n## Supported Provider Keys\r\n\r\n| Provider | Key |\r\n|----------|-----|\r\n| Cloudflare | cloudflare |\r\n| Fastly | fastly |\r\n| Akamai | akamai |\r\n| Amazon CloudFront | amazoncloudfront |\r\n| KeyCDN | keyIcon |\r\n| Gcore | gcore |\r\n\r\n---\r\n\r\n## Example Use Cases\r\n\r\n- Design system icon delivery\r\n- Build-time SVG processing\r\n- Static asset validation\r\n- CI/CD asset pipelines\r\n- Server-side icon rendering\r\n- CDN asset synchronization\r\n\r\n---\r\n\r\n## Error Handling\r\n\r\nThe library provides runtime error handling for:\r\n\r\n- Unsupported providers\r\n- Network failures\r\n- Invalid HTTP responses\r\n- JSON parsing failures\r\n- Plugin loading failures\r\n\r\n---\r\n\r\n## Performance\r\n\r\nBuilt around:\r\n\r\n- Asynchronous filesystem operations\r\n- Non-blocking network requests\r\n- Recursive directory traversal\r\n- Runtime plugin execution\r\n\r\n---\r\n\r\n## License\r\n\r\nMIT\r\n\r\n---\r\n\r\n## Contributing\r\n\r\nIssues, feature requests, and pull requests are welcome.\r\n\r\nPlease open an issue before submitting major architectural changes.","readmeFilename":"README.md"}