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

tilegen

v0.5.2

Published

🗺️ Slice large images into map-style tiles at multiple zoom levels.

Readme

🗺️ tilegen

A fast, multi-threaded tool to slice large images into map‑style tiles at multiple zoom levels.

Features

  • Automatic zoom‑level calculation: Dynamically determines how deep to go based on image dimensions and a configurable magnification factor.
  • Worker‑thread pool: Fully utilizes all CPU cores via worker_threads.

Installation

NPM

# npm
npm install tilegen -g
# yarn
yarn add tilegen -g
# pnpm
pnpm add tilegen -g
# bun
bun add tilegen -g

Source

Before installing, make sure you have Bun installed on your system.

git clone https://github.com/itsbrunodev/tilegen.git
cd tilegen
bun install

Usage

Help

To get help, run the following command:

tilegen -h

CLI

tilegen can be used from the command-line with the following options:

| Option | Description | Default | | --- | --- | --- | | -t, --tile-size <TILE_SIZE> | The tile size of each image. | 256 | | -f, --tile-format <TILE_FORMAT> | The format of the output tiles. | webp | | -m, --max-mag <MAXIMUM_MAGNIFICATION> | The maximum magnification factor. | 1 | | -i, --input <INPUT_PATH> | The path to the input image. | ./input.png | | -o, --output <OUTPUT_DIR> | The path to the output directory where the tiles will be saved. | ./out/ |

Example usage

tilegen -t 512 -f webp -m 4 -i ./input.png -o ./out/

This will generate tiles at ./out/{z}/{x}/{y}.webp, with a tile size of 512 and a maximum magnification of 4 from the input image ./input.png.

What is maximum magnification?

MAXIMUM_MAGNIFICATION controls how deep your zoom levels go. It adjusts how many source‑pixels each tile covers at the deepest level.

Increasing it by 1 gives you one extra zoom‑in level (more detail at deepest zoom), at the cost of more tiles and storage.

For example, if MAXIMUM_MAGNIFICATION is 4, at the deepest zoom level, each tile will cover 4x4 = 16 source pixels. If the input image is 1024x1024, this means there will be 4 zoom levels in total (2^4 = 16).

Demo

itsbrunodev/colonycraft is a map based on the ColonyCraft Minecraft server. The image of the map was generated using mc-mapper.

How it works

  • First, the tool reads the input image's dimensions to understand its size.
  • It then automatically calculates the optimal number of zoom levels based on the image's resolution and a configurable MAXIMUM_MAGNIFICATION setting.
  • A queue of tasks is created, where each task corresponds to a single tile at a specific zoom level and coordinate.
  • A pool of worker threads then uses all available CPU cores to process these tasks in parallel, rapidly slicing and resizing sections of the source image.
  • Finally, the generated tiles are saved into a standard z/x/y.png directory structure, making them ready for use with web viewers (like Leaflet).

License

tilegen is under the MIT license.