New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@iconify/react

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iconify/react - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

18

build.js

@@ -27,2 +27,5 @@ /**

// Ignore errors
let ignoreErrors = false;
// Source directory

@@ -302,3 +305,3 @@ let sourceDir = null;

if (log) {
console.log('[' + collection.prefix() + ']: Exported ' + icons + ' icons' + (aliases ? ', ' + aliases + ' aliases.' : ''));
console.log('[' + collection.prefix() + '] Exported ' + icons + ' icons' + (aliases ? ', ' + aliases + ' aliases.' : ''));
}

@@ -442,2 +445,6 @@ return true;

case '--ignore-errors':
ignoreErrors = true;
break;
case '--silent':

@@ -509,2 +516,5 @@ case '--no-log':

if (!Object.keys(files).length) {
if (ignoreErrors) {
return;
}
throw new Error('No JSON files to parse.');

@@ -523,2 +533,5 @@ }

if (!collection.loadFromFile(source)) {
if (ignoreErrors) {
return;
}
throw new Error('Error loading collection from ' + source);

@@ -529,2 +542,5 @@ }

if (validatePrefix) {
if (ignoreErrors) {
return;
}
throw new Error('Collection loaded from ' + source + ' has prefix "' + collection.prefix() + '", expected "' + prefix + '"');

@@ -531,0 +547,0 @@ }

8

package.json

@@ -5,3 +5,3 @@ {

"author": "Vjacheslav Trushkin",
"version": "0.0.1",
"version": "0.0.2",
"license": "MIT",

@@ -18,9 +18,7 @@ "bugs": "https://github.com/iconify-design/iconify-react/issues",

"main": "icon.js",
"devDependencies": {
"dependencies": {
"@iconify/json-tools": "^1.0.3",
"react": "^16.7.0"
},
"optionalDependencies": {
"react": "^16.7.0",
"@iconify/json": "^1.0.48"
}
}

@@ -40,3 +40,6 @@ # Iconify for React

## Importing icons
Import format for each icon is "@iconify/react/{prefix}/{icon}" where {prefix} is collection prefix, {icon} is icon name.
Import imports JSON data for icon, to render it use Icon or InlineIcon component.

@@ -46,2 +49,39 @@

You can use any name for imported icon. For example:
```
import notCat from "@iconify/react/noto-v1/dog";
```
## Build script
You can use build script with custom icon sets that have been converted to [Iconify JSON format](https://iconify.design/docs/json-icon-format/).
Add your own JSON files to directory "json", run build script from command line:
```
node node_modules/@iconify/react/build --source json --target icons
```
where "json" is directory where JSON files are, "icons" is directory where components will be exported.
There are more command line options:
* --skip foo,bar: list of prefixes to ignore.
* --filter foo,bar: list of prefixes to include. If set, all other prefixes will be ignored
* --file json/custom.json: file to parse
* --files json/custom.json,json/custom2.json: list of additional files to parse, separated by comma.
* --package @iconify/json: parse JSON files in installed package. Use in combination with --dir if files are in sub-directory (see package.json for example).
* --source json: directory where JSON files are located.
* --dir json: sub-directory where JSON files are located, used in combination with --package (see package.json for example).
* --target icons: directory where to save components. Build script will also create sub-directories with prefixes, so for example fa-home will be in icons/fa/home.js
* --no-cleanup: prevent build script from deleting old files. By default everything in target directory is removed to clean up old build data, this will prevent clean up.
* --silent: prevent build script from logging export process.
* --ignore-prefix: do not validate prefixes. By default build script requires filenames to match prefixes, so for example "fa-solid" should be in "fa-solid.json", adding this to command line will prevent that check.
* --ignore-errors: do not stop on error. This applies only to invalid json files. Script will throw errors even with --ignore-errors when there are bad command line parameters.
Examples:
```node node_modules/@iconify/react/build --source json --target icons
node node_modules/@iconify/react/build --module @iconify/json --dir json --target iconify-icons --filter fa-brands,logos,brandico
node node_modules/@iconify/react/build --module @iconify/json --dir json --target iconify-icons --skip fa-brands,logos,brandico --silent
```
## License

@@ -48,0 +88,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc