🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

gulp-spritezero

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-spritezero

Mapbox's spritezero package wrapped as a gulp plugin

1.5.0
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

gulp-spritezero

Gulp plugin for generating spritesheets using spritezero for Mapbox.

Install

npm install gulp-spritezero

Usage

The following gulp task will generate dest/sprite.png and dest/sprite.json from all SVG files in the src directory.

var gulp = require('gulp');
var spritezero = require('gulp-spritezero');

gulp.task('spritezero', function() {
  return gulp.src('src/**/*.svg')
    .pipe(spritezero({
      scales: [ 1 ]
    }))
    .pipe(gulp.dest('./dest'));
});

If no options are passed to the plugin, 4 files will be generated by default:

  • dest/sprite.png
  • dest/sprite.json
  • dest/sprite@2x.png
  • dest/sprite@2x.json

Options

KeyValue TypeDefaultDescription
scalesArray.<Number>[ 1, 2 ]Array of scales to generate sprites for
nameString'sprite'Base name for the sprite files
sdfBooleanfalseRender the sprites in SDF format

Author

Matthew Wagerfield: @wagerfield

License

Licensed under MIT. Enjoy.

Keywords

gulpplugin

FAQs

Package last updated on 24 May 2016

Did you know?

Socket

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