npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mimosa-sprite

v0.6.0

Published

A module for Mimosa to generate sprites and corresponding Stylus/LESS/SASS/CSS

Downloads

24

Readme

mimosa-sprite

Overview

This is a module that will generate CSS sprites and corresponding stylesheets for your Mimosa project.

For an example Mimosa app that uses this module, checkout the MimosaSpriteExample project.

For more information regarding Mimosa, see http://mimosa.io.

Note: v0.5.0 of mimosa-sprite requires 2.2.17 of Mimosa.

Usage

Add 'sprite' to your list of modules. That's all! Mimosa will install the module for you when you start up.

This module depends on node-sprite-generator which in turn requires that you have either Cairo or Image/GraphicsMagick installed. So, for example, is you are using brew, you should execute brew install GraphicsMagick and brew install ImageMagick prior to using this module. See the node-sprite-generator installation docs for details.

Once this module has been added to your project, just execute mimosa sprite to generate your sprites. This module comes with some default config (see below) and if your project matches that config, you won't have any other work to do.

Functionality

This module will generate sprite images and Stylus/SASS/LESS/CSS artifacts for those sprites.

Sprites will be generated for each folder in the sprite.inDir. So, if sprite.inDir points to images/sprite (the default), and inside images/sprite there are 3 folders named foo, bar and baz, then 3 sprite .pngs will be created called foo.png, bar.png and baz.png. Those images will be placed in the sprite.outDir, which is by default images.

For each sprite created, this module will place a stylesheet asset (either SASS, LESS, Stylus or CSS depending on config, Stylus by default), in the sprite.stylesheetOutDir.

If you are building many sprites, and those sprites have a set of images in common, you can place the common images in the sprite.commonDir, by default images/sprite/common. This special folder will not create a sprite of its own, but any images inside this folder will be included in all sprites.

node-sprite-generator offers up a large set of configuration options. sprite.options can be used to override and set those options. sprite.options can be an object or a function. If it is an object, the values in the object will overwrite the config mimosa-sprite creates for each sprite. If sprite.options is a function, it will be called with the generated config giving you the opportunity to modify it. This provides a programmatic means to update or override the configuration.

Default Config

sprite: {
  inDir: "images/sprite",
  outDir: "images",
  commonDir: "common",
  stylesheetOutDir: "stylesheets/sprite",
  options: {
    stylesheet:"stylus"
  }
}
  • inDir: a string. The folder inside which are the images to be sprited. Every folder at the root of this folder will generate a single sprite. This path is relative to watch.sourceDir, which defaults to assets
  • outDir: Where to place generated sprites relative to watch.sourceDir Placing the output images outside the sprite directory makes it easy to exclude the sprite directory from being copied to watch.compiledDir.
  • commonDir: Folder inside which are images to be included in every sprite. This is a string path relative to inDir.
  • stylesheetOutDir: Where to place the output stylesheets. Path is relative to watch.sourceDir
  • options, an object or function. Pass-through options for node-sprite-generator, the tool this module uses under the hood to do the heavy lifting. mimosa-sprite provides the values for that tool's src, spritePath and stylesheetPath based on the inDir folder's structure. Other config options can be placed in this options object. For more control, options can be a function that takes the inferred config generated by mimosa-sprite. If you are generating 10 sprites, the options function will be called 10 times for each sprite, giving you the chance to make specific modifications to the node-sprite-generator config.
  • options.stylesheet: A string, the type of stylesheet to output. Valid values: stylus, less, sass, scss, css.

Example Config

sprite:
  options:
    layout: 'horizontal'
    stylesheet: 'sass'
  • sprite.options.layout is a pass-through to node-sprite-generator's layout config. This is one example of providing config through to node-sprite-generator.
  • sprite.options.stylesheet tells node-sprite-generator to output sass code.