šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

bonder

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bonder

Creates CSS and SVG sprites.

0.2.4
latest
Source
npm
Version published
Weekly downloads
3
-50%
Maintainers
1
Weekly downloads
Ā 
Created
Source

Spriter

Creates sprite images.

  • Generates horizontal, vertical and smart(compact) sprites.
  • Can add images to existent sprites without modifying other images positions.
  • Can get positions from existent sprites for already sprited images and create new sprite for other.

Requirements

Spriter requires node-imagemagick which depends on Imagemagick.

There are many ways to install Imagemagick. For example, if you are using OS X, you can use Homebrew: brew install imagemagick.

Usage

Install with npm:

$ [sudo] npm install spriter --save

If you want to use spriter on your cli install with:

$ [sudo] npm install spriter -g

CLI

Usage:

$ spriter <src> <output> [options...]

src     Glob string(s) or file path(s) to find source images for spriting
output  Output sprite filepath

Options:

    -h, --help : Help
    -v, --version : Version
    -o OUTPUT, --output=OUTPUT : Path of directory to write sprite file to [./sprites]
    -n NAME, --name=NAME : Name of sprite file  [common]
    -e EXTENSION, --ext=EXTENSION : Extension of sprite file  [png]
    -i IFEXISTS, --ifexists=IFEXISTS : Action for already existent sprite  [override]
    -l LAYOUT, --layout=LAYOUT : Layout of the sprite image  [smart]
    -p PADDINGS, --padding=PADDINGS : Tiles padding in px  [2]

Example:

    $ spriter '**/*.png' -o './sprited' -n 'common'

JS API

Usage:

var spriter = require('spriter');

spriter.api(options).then(cb);

Options:

  • src: Glob string(s) or file path(s) to find source images to put into the sprite [required]
  • path: Path of directory to write sprite file to [./sprites]
  • name: Name of sprite file [common]
  • ext: Extension of sprite file [png]
  • ifexists: Action for already existent sprite: override, add or use [override]
  • layout: Layout of the sprite image: smart, horizontal or vertical [smart]
  • padding: Tiles padding in px [2]

Example:

var Spriter = require('spriter');

Spriter
    .api({
        src : [ '**/*.png' ],
        path : './sprited',
        name : 'common'
    })
    .spread(function(images, sprites) {
        console.log('done');
    });

Checkout more examples at /examples and /tests.

FAQs

Package last updated on 27 Mar 2015

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