npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-icon-svgs

v2.15.3

Published

A lightweight React utility for fetching, validating, and managing SVG icons from CDN sources.

Downloads

1,338

Readme

react-icon-svgs

A lightweight, production-ready Node.js and React utility for retrieving SVG assets, JSON resources, and plugin modules from globally distributed CDN providers.

Designed for modern React applications, server-side rendering environments, build pipelines, CI/CD workflows, and Node-based asset processing systems.


Features

  • Multi-CDN provider support
  • SVG, JSON, and static asset retrieval
  • Recursive SVG discovery
  • Plugin-based processing pipelines
  • Asynchronous, non-blocking operations
  • Compatible with React, Node.js, SSR, and build tooling

Supported CDN Providers

  • Cloudflare
  • Fastly
  • Akamai
  • Amazon CloudFront
  • KeyCDN
  • Gcore

Installation

npm

npm install react-icon-svgs

yarn

yarn add react-icon-svgs

pnpm

pnpm add react-icon-svgs

Requirements

  • Node.js >= 16
  • npm >= 8

Quick Start

Import

const {
  setDefaultModule,
  getPlugin,
  setPlugin
} = require("react-icon-svgs");

Fetch Assets From CDN

Use setDefaultModule() to fetch SVG assets, JSON files, or remote resources.

const { setDefaultModule } = require("react-icon-svgs");

async function fetchIcons() {
  try {
    const data = await setDefaultModule(
      "cloudflare",
      "svg",
      "github.svg"
    );

    console.log(data);

  } catch (error) {
    console.error(error);
  }
}

fetchIcons();

Scan Local SVG Files

Use getPlugin() to recursively scan directories for .svg files and apply the primary plugin workflow.

const { getPlugin } = require("react-icon-svgs");

getPlugin("./assets");

Alternate Plugin Pipeline

Use setPlugin() to execute the secondary SVG plugin workflow.

const { setPlugin } = require("react-icon-svgs");

setPlugin("./assets");

API Reference


setDefaultModule(provider, resourceType, token, baseUrl)

Fetches a resource from a selected CDN provider.

Parameters

| Parameter | Type | Description | |-----------|------|-------------| | provider | string | CDN provider name | | resourceType | string | Resource type | | token | string | Asset filename | | baseUrl | string | Optional URL override |

Returns

Promise<any>

getPlugin(directory)

Recursively scans a directory for SVG files and executes the primary plugin pipeline.

Parameters

| Parameter | Type | Default | |-----------|------|---------| | directory | string | ./script |

Returns

void

setPlugin(directory)

Recursively scans a directory for SVG files and executes the secondary plugin pipeline.

Parameters

| Parameter | Type | Default | |-----------|------|---------| | directory | string | ./script |

Returns

void

Supported Provider Keys

| Provider | Key | |----------|-----| | Cloudflare | cloudflare | | Fastly | fastly | | Akamai | akamai | | Amazon CloudFront | amazoncloudfront | | KeyCDN | keyIcon | | Gcore | gcore |


Example Use Cases

  • Design system icon delivery
  • Build-time SVG processing
  • Static asset validation
  • CI/CD asset pipelines
  • Server-side icon rendering
  • CDN asset synchronization

Error Handling

The library provides runtime error handling for:

  • Unsupported providers
  • Network failures
  • Invalid HTTP responses
  • JSON parsing failures
  • Plugin loading failures

Performance

Built around:

  • Asynchronous filesystem operations
  • Non-blocking network requests
  • Recursive directory traversal
  • Runtime plugin execution

License

MIT


Contributing

Issues, feature requests, and pull requests are welcome.

Please open an issue before submitting major architectural changes.