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);
    });

    Install

    npm i coveo-png-sprite

    DownloadsWeekly Downloads

    1,427

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    12 kB

    Total Files

    11

    Last publish

    Collaborators

    • mmitiche
    • jkatofsky
    • agong-coveo
    • lrett
    • pixhel
    • ndlr
    • npmcoveo
    • camarois
    • lcoolen
    • coveo-organization
    • coveoit
    • olamothe
    • jfthibodeaucoveo
    • btaillon_cov
    • sssayegh
    • ylakhdar
    • germainbergeron
    • gdostie
    • fblais
    • dgauthier