Skip to content

Latest commit

 

History

History
56 lines (39 loc) · 982 Bytes

README.md

File metadata and controls

56 lines (39 loc) · 982 Bytes

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