# broccoli-svg-sprite

> A broccoli.js plugin for generating svg sprites using node.js svg-sprite module by Joschi Kuphal (https://github.com/jkphl/svg-sprite)

Latest version **1.0.6** (published 2020-10-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install broccoli-svg-sprite
pnpm add broccoli-svg-sprite
yarn add broccoli-svg-sprite
bun add broccoli-svg-sprite
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2020-10-27 |
| First published | 2015-07-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 12 |
| Unpacked size | 3.9 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Sanket Sharma |
| Maintainers | themojojojo |
| Keywords | broccoli-plugin, broccoli.js, svg, svg-sprite, sprite, icon, icons, svg, png, sprite, spritesheet, stack, generator, css, sass, less, stylus, stylesheet, inline, html, vector, rwd, retina, mustache |

## Links

- npm: https://www.npmjs.com/package/broccoli-svg-sprite
- Repository: https://github.com/MojoJojo/broccoli-svg-sprite
- Issues: https://github.com/MojoJojo/broccoli-svg-sprite/issues
- npm.io page: https://npm.io/package/broccoli-svg-sprite

## Dependencies (12)

- [less](https://npm.io/package/less.md) ^3.12.0
- [path](https://npm.io/package/path.md) ^0.11.14
- [rsvp](https://npm.io/package/rsvp.md) ^3.0.18
- [vinyl](https://npm.io/package/vinyl.md) ^0.5.0
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [rimraf](https://npm.io/package/rimraf.md)
- [stylus](https://npm.io/package/stylus.md) ^0.51.1
- [node-sass](https://npm.io/package/node-sass.md) ^4.5.0
- [glob-array](https://npm.io/package/glob-array.md) ^0.1.2
- [svg-sprite](https://npm.io/package/svg-sprite.md) ^1.2.3
- [glob-to-regexp](https://npm.io/package/glob-to-regexp.md) 0.0.2
- [broccoli-caching-writer](https://npm.io/package/broccoli-caching-writer.md) ^3.0.0

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [stockfish](https://npm.io/package/stockfish.md) — 27.0K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads

## Recent versions

- 1.0.6 (latest) — 2020-10-27
- 1.0.5 — 2018-12-12
- 1.0.4 — 2017-08-06
- 1.0.3 — 2015-07-01
- 1.0.2 — 2015-07-01
- 1.0.1 — 2015-07-01
- 1.0.0 — 2015-07-01

## README

# broccoli-svg-sprite ![Build Status](https://travis-ci.org/MojoJojo/broccoli-svg-sprite.svg?branch=master)

The broccoli-svg-sprite plugin provides a wrapper around node.js svg-sprite module which takes a set of svg files, optimizes them and combines them into SVG sprites of several types



## Installation

npm install --save-dev broccoli-svg-sprite


## Usage

The broccoli-svg-sprite plugin is just a wrapper around the svg-sprite module. To use the plugin in your broccoli project, first import the plugin into your project:


`
var spriter = require('broccoli-svg-sprite');
`


Then, just instantiate a new spriter object passing in the appropriate options:


`
var svgSpriter = new spriter(srcFiles, spriteOptions);
`


where

```
srcFiles: is a data object containing:
	srcDir: the base directory containing your svg files.
	include: An array of inclusion glob patterns to filter files.
	exclude: An array of exclusion glob patterns to filter files.

spriteOptions: is a data object that will be passed as such to the svg-sprite module. For a detailed explanation of all available options, refer to https://github.com/jkphl/svg-sprite
```


## Example:

```
var svgSpriter = new spriter(srcFiles, spriteOptions);
var srcFiles = {
  srcDir: 'svgs',
  include: ['**/*.svg'],
  exclude: []
};
var svgOptions = {
    dest: '.',

    shape: {
        spacing: { // Spacing related options
            padding: 1, // Padding around all shapes
            box: 'content' // Padding strategy (similar to CSS `box-sizing`)
        },
    },
    mode: {
        view: { // Activate the «view» mode
            dest: 'assets/images',
            bust: false,
            render: {
                css: {
                    dest: '../../app/styles/less/sprite.css'
                },



                scss: false,
                styl: false
            },
            prefix: 'svg-view-id',
            sprite: 'cw-svg-views-sprite.svg',
            example: false
        },
    }

};

var spriter = new svgSpriter(srcFiles, svgOptions);

module.exports = mergeTree([app.toTree(), spriter]);
```


## Tests
```
npm install
mocha test

```
## Acknowledgements
* Joschi Kuphal (https://github.com/jkphl/svg-sprite)
* Robert Jackson https://github.com/rwjblue
* Jo Liss (https://github.com/joliss)

---
_Source: https://npm.io/package/broccoli-svg-sprite · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
