svgdir2sprite

1.0.5 • Public • Published

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

Package Sidebar

Install

npm i svgdir2sprite

Weekly Downloads

126

Version

1.0.5

License

MIT

Unpacked Size

3.94 kB

Total Files

5

Last publish

Collaborators

  • sharpshark28