Creates a spritesheet from a directory of svgs.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
cli.js
index.js
package-lock.json
package.json

README.md

svgdir2sprite

npm version

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