Socket
Socket
Sign inDemoInstall

@superkoders/node-modules-svg-loader

Package Overview
Dependencies
8
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @superkoders/node-modules-svg-loader

Copy specified svg icons from node_modules folder to your project


Version published
Maintainers
2
Install size
8.09 MB
Created

Readme

Source

Node modules SVG loader

Plugin for fetching specified SVGs from npm or any relative destination (e.g. FontAwesome, subfolder) to project's source folder, where you can build your own subset svg sprite or anything you desire. You can then have every icon within reach, while keeping project sprite as minimal as possible.

Installation and configuration

Install with

npm i -D @superkoders/node-modules-svg-loader

And then make gulp task like this or similar, which integrate with your workflow.

const svgLoader = require('@superkoders/node-modules-svg-loader');

module.exports = function svgLoad(done) {
	svgLoader({
		iconSource: './fontawesome-pro-5.11.2-web/svgs',
		projectIconFolder: './src/img/bg/icons-svg/',
		iconList: './src/img/icon-list.json',
	}, done);
	done();
};

In the task specify:

  1. root folder of your source icons in iconSource.
  2. path to folder, where you keep icons you use in the project.
  3. path to the JSON where you specify which icons you want to load.

Usage

icon-list.json

For each icon specify relative path from iconSource and new name. You can also specify path, if you need to create new structure. Extension .svg is going to be added automatically.

{
	"icons": [
		{
			"finalName": "technlogy-brain",
			"src": "02-Technology/01-Artificial-Intelligence/brain"
		},
		{
			"finalName": "technlogy/ai/brain",
			"src": "02-Technology/01-Artificial-Intelligence/brain"
		},
	]
}

Author

N|Superkoders

License

This project is licensed under the MIT License - see the LICENSE.md file for details

FAQs

Last updated on 16 Jun 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc