Skip to content

NiceLabs/sprit

Repository files navigation

sprit

NPM version

sprit features:

  • Generates sprites and proper style files out of a directory of images.
  • Supports multiple rendering engine (jimp, canvas)

Installation

npm install sprit

Usage

Programmatic usage

import * as sprit from 'sprit';

sprit.create({
  src: [
    './icons/*.png', // include files
    '!./icons/ignore-*.png', // ignore files
  ],
});

Programmatic usage with Gulp

const gulp = require('gulp');
const sprit = require('sprit');

gulp.task('sprite', () => {
  const options = {
    src: [
      './icons/*.png', // include files
      '!./icons/ignore-*.png', // ignore files
    ],
  };
  return sprit.src(options).pipe(gulp.dest('./dist'));
});

Thank

LICENSE

The MIT License (MIT)

see LICENSE

Releases

No releases published

Packages