Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@icon-magic/config-reader

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@icon-magic/config-reader

Icon magic config parsing/reading/writing package.

  • 2.2.1-beta.0
  • npm
  • Socket score

Version published
Weekly downloads
16
increased by433.33%
Maintainers
3
Weekly downloads
 
Created
Source

@icon-magic/config-reader

This module is responsible for finding the closest config file(iconrc.json/iconrc.js/icon) to an icon and resolving all the paths in the config file so it's relative to the icon bundle. It helps in

  • Locating config files within directories
  • Provides utils to read, validate and write icon config files
  • Defining and managing the data for each icon
  • Managing the config data for a set of icons in memory via a hash

Interface

getIconConfigSet(inputPaths: string[]): IconConfigHash

This is the primary method that the bundle exposes and is responsible for taking a set of input paths and constructing a map of the path to the icon and it's corresponding config JSON that should, entirely represent the characteristics of the icon. It validates the structure of all the configs as well.

An example input iconrc.json looks like this. Refer to @icon-magic/config-reader/schemas/config-schema for a detailed description of the various fields

{
  "iconPath": "*",
  "variants": [
    {
      "path": "./filled.svg"
    },
    {
      "name": "someOtherName",
      "path": "./outline.svg"
    }
  ],
  "sizes": [24],
  "resolutions": [1],
  "build": {
    "outputPath": "./out"
  },
  "generate": {
    "outputPath": "./out",
    "types": [
      {
        "name": "svg",
        "plugins": []
      },
      {
        "name": "raster",
        "plugins": []
      }
    ]
  }
}

For more details on the interfaces, refer to @icon-magic/icon-models

FAQs

Package last updated on 14 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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