Socket
Socket
Sign inDemoInstall

broccoli-svg-concatenator

Package Overview
Dependencies
26
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    broccoli-svg-concatenator

A Broccoli tree that concatenates all SVG files in a tree into a hash exported on window.


Version published
Weekly downloads
1
Maintainers
1
Install size
2.59 MB
Created
Weekly downloads
 

Readme

Source

broccoli-svg-concatenator

A Broccoli tree that concatenates all SVG files in a tree into a hash exported on window.

This way you can include SVG graphics directly in your code and render it to the DOM without extra network requests.

Installation

npm install --save broccoli-svg-concatenator

Usage

var tree = concatSvg(inputTree, options);

Example:

var concatSvg = require('broccoli-svg-concatenator');

var svg = concatSvg('public/assets/images', {
    outputFile: 'assets/svg.js',
    name: 'MySvg'
});

Will find all .svg files inside public/assets/images and save a file to assets/svg.js like this:

window.MySvg = {
    'icons/house': '...svg...',
    'shapes/circle': '...svg...'
};

Options

  • outputFile required: The file to write the SVG contents to.
  • name: The name of the variable exposed on window containing all the SVG contents. Defaults to Svg.

FAQs

Last updated on 27 Aug 2014

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