react-svg-render
v1.0.2
Published
A module to provide an react svg.
Readme
React SVG Render
React SVG Render is a Node.js library that allows you to fetch resources from various icon CDN providers. It supports fetching icons, images, content, JavaScript, and JSON files from popular providers like Cloudflare, Fastly, KeyCDN, Akamai, Amazon CloudFront, and Gcore.
Installation
To install the package, use npm:
npm install react-svg-renderUsage
Fetching a Resource from a CDN Provider
To fetch a resource from a specified module, use the fetchIconProvider function. This function requires the icon provider, resource type, token, and base URL as parameters.
const { setDefault } = require("react-svg-render");
setDefault(
"cloudflare",
"icon",
"your-token",
"https://your-base-url.com"
)
.then((data) => {
console.log("Resource data:", data);
})
.catch((error) => {
console.error("Error fetching resource:", error);
});License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
Changelog
[1.2.0] - 2025-2-12
- Added support for additional Icon modules.
- Improved error handling and retry logic.
- Updated documentation and examples.
