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

@react-vector-graphics/core

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-vector-graphics/core

Core library of react-vector-graphics

  • 0.4.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
62
increased by58.97%
Maintainers
2
Weekly downloads
 
Created
Source

@react-vector-graphics/core

This config files for this package should be backwards compatible with @svgr/svgr

Usage

const rgvCore = require("@react-vector-graphics/core").default;
const myPlugin = require("./myPlugin");

const config = {
    plugins: [
        "@react-vector-graphics/plugin-assets",
        myPlugin,
        "@svgr/plugin-svgo"
    ],
    options: {
        "assets/globPattern": "./assets/*.svg"
    },
    svgoConfig: {
        multipass: true
    }
};

rvgCore({ config, logger: console });

Configuration

This is an super set of the svgr configuration.

See @react-vector-graphics/types for definitions.

plugins

The plugins that will be run in order. These can be module names as strings which will then imported to get the underlying function or functions that will be called directly with the options and other parameters

options

The options that the plugins will be initiated with. It is a good idea to namespace the path in the config.options to prevent collisions between independent plugins.

{
    "plugins": ["myPlugin", "other-plugin"],
    "options": {
        "myPlugin/shrink": false,
        "otherPlugin/shrink": true
    }
}

Plugins

Plugins are functions that will be called with the following parameters in order.

code

A string representing the svg file that has been read and modified so far

config

The initial configuration object, see config.

state

The current state of execution, can be modified by plugins to pass information to other plugins further down in the execution chain. The namespacing recommendation as the options applies.

logger

This is an optional argument that allows the plugin to log output with custom levels.

NOTE: this is not guaranteed to exist and defaults to console.

FAQs

Package last updated on 19 Sep 2020

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