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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@solaldr/spritesheet

v1.0.0

Published

[![test](https://github.com/SolalDR/spritesheet/workflows/test/badge.svg?branch=master)](https://github.com/SolalDR/spritesheet/actions?workflow=test) [![build](https://github.com/SolalDR/spritesheet/workflows/build/badge.svg?branch=master)](https://githu

Downloads

4

Readme

spritesheet

test build version

Description

This library is an easy and customizable way to generate optimized spritesheet through a CLI.

Features

  • [x] JSON map generation (store all the images coords)
  • [x] Fast images processing using sharp
  • [x] Space optimisation: optimize space in the spritesheet to store the more images possible
  • [x] Auto-resize : if there isn't enough space in the spritesheet the chunk will resize down until fit perfectly in the spritesheet
  • [x] Pass multiple input to get multiples sprites in the same texture
  • [ ] (Incomming) Multiple textures generation

Installation

npm i -g @solaldr/spritesheet

CLI

Basic use :

spritesheet --input ./myimagesdir

| option |type | description |default| |------------------------------|------|--------------------------------------------|----------- | --w, --width |number| Width of the output spritesheet file |2048 | --h, --height |number| Height of the output spritesheet file |2048 | --chunk.width, --c.w |number| Width of a single chunk |auto (spread amoung disponible space) | --chunk.height, --c.h |number| Height of a single chunk |auto (spread amoung disponible space) | --flexibility |number| Resize factor of a chunk |auto (spread amoung disponible space) | --output |string| Output name of the spritesheet |output | --input |string| Path to parent directory of target images | | --name |string| Name of the spritesheet |

Docs

--input

The input parameter describle the way images will be inported.

--output

The output parameter describle in which directory the spritesheet will be generated.

--name

The name of the spritesheet {name}.json

--width, --w

Represent the width (in pixels) of the output spritesheet. If width is undefined, width will calculated automatically Notice: A power of two is recommanded

--height, --h

Represent the height(px) of the output spritesheet. If height is undefined, height will be equal to the width value Notice: A power of two is recommanded

--chunk.width, --c.w

Each image passed as an input in the CLI create a single chunk. A chunk is defined by the following properties: width, height, x, y Represent the width of a chunk. If this parameter is undefined, the computed width will be constrained by the spritesheet dimensions. For instance, if a spritesheet has dimensions 2048x2048, However the number of chunks, they will be resized automatically to fit inside this dimensions. See --flexibility option for more informations.

--chunk.height, --c.h

Represent the height of a chunk. See chunk.width behavior

--flexibility

The capacity of a chunk to resize in order to fit inside spritesheet dimensions. The parameter is ranged between 0 and 1. Example: If --flexibility 0.5 a chunk will be able to resize down, up to 50% of his width By default:

  • If chunk.width or chunk.height id defined, flexibility will be equal to 0 The chunks will not resize
  • If neither chunk.width or chunk.height is defined, flexibility will be equal to 1 The chunks will resize to fit inside the spritesheet

How to contribute

Install dependencies

npm install

Install and init commitizen

npm install commitizen -g
commitizen init cz-conventional-changelog --save-dev --save-exact
npm run dev

Commit your work

npm run commit

License

MIT.