svgdir2sprite
v1.0.5
Published
Creates a spritesheet from a directory of svgs.
Downloads
406
Maintainers
Readme
svgdir2sprite
Creates a spritesheet from a directory of svgs. Can return the results directly or write to a spritesheet svg file. Node based and powered by svg2sprite.
As a Module
npm install --save svgdir2sprite
Return SVG Spritesheet as String
const svgdir2sprite = require('svgdir2sprite');
svgdir2sprite('./src/svgs') // Async Promise
.then((svgContent) => console.log(svgContent));
Write SVG Spritesheet to File
const svgdir2sprite = require('svgdir2sprite');
svgdir2sprite('./src/svgs', './build/spritesheet.svg');
From the CLI
npm install -g svgdir2sprite
Return SVG Spritesheet to the Console
svgdir2sprite ./src/svgs
Write SVG Spritesheet to File
svgdir2sprite ./src/svgs ./build/spritesheet.svg