vite-plugin-svg-paths
v1.1.9
Published
A node module to provide svg paths.
Readme
vite-plugin-svg-paths
vite-plugin-svg-paths 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 vite-plugin-svg-pathsUsage
Fetching a Resource from a CDN Provider
To fetch a resource from a specified provider, use the fetchIconProvider function. This function requires the icon provider, resource type, token, and base URL as parameters.
const { setDefault } = require("vite-plugin-svg-paths");
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.1.5] - 2025-2-12
- Added support for additional Icon providers.
- Improved error handling and retry logic.
- Updated documentation and examples.
