coveo-png-sprite

1.0.1 • Public • Published

coveo-png-sprite

npm dependencies Code Climate license

coveo-png-sprite is a gulp module that creates sprite sheets from multiple images

var gulp = require('gulp');
var pngSprite = require('coveo-png-sprite');
 
gulp.task('buildSprites', function (done) {
  return gulp.src('img/**/*.png')
      .pipe(pngSprite.gulp({
        cssPath: 'sprites.scss',
        pngPath: 'sprites.png',
        namespace: 'sprites'
      }))
      .pipe(gulp.dest('./target/'))
});
var fs = require('fs');
var Sprite = require('coveo-png-sprite').Sprite;
var sprite = new Sprite();
sprite.addImageSrc([
  "./img/a.png",
  "./img/b.png",
  "./img/c.png",
  "./img/d.png"
], function(){
  var obj = sprite.compile('./sprite.png');
  obj.png.pipe(fs.createWriteStream('sprite.png'));
  fs.writeFile('sprite.css', obj.css);
});

Package Sidebar

Install

npm i coveo-png-sprite

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

12 kB

Total Files

11

Last publish

Collaborators

  • nlegros
  • msrioux
  • sallain
  • aboissinot
  • mmitiche
  • jkatofsky
  • agong-coveo
  • pixhel
  • ndlr
  • npmcoveo
  • lcoolen
  • coveo-organization
  • coveoit
  • olamothe
  • sssayegh
  • ylakhdar
  • germainbergeron
  • gdostie
  • fblais
  • dgauthier