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

pantiler

v1.6.0

Published

Convert geographic data into vector map tiles

Downloads

15

Readme

Pantiler

Convert geographic data into vector map tiles.

Installing

$ npm install -g pantiler

Alternatively, don't install it and just prepend the command with npx.

Usage

In the terminal:

$ pantiler <tilefile> <directory>

The directory is where the tiles will be created, and should not already exist. Downloaded and processed files will be cached into a directory named .pantiler-cache, and can then be used to speed up subsequent runs. The cache can be automatically removed when Pantiler finishes successfully with -c.

The tiles are just static files that can then be hosted on S3, for example. They can then be rendered in the browser with Mapbox GL, or any other library that supports vector tiles. See example.html for what this looks like.

Pantiler can also be used as a library. To import it:

import Pantiler from 'pantiler'

Then set it up:

const pantiler = Pantiler(directory, cache, clearCache, bounds, alert)

Where:

  • directory Where the tiles will be created, should not already exist.
  • cache The name of a directory where files will be cached. Optional. Default is .pantiler-cache.
  • clearCache Remove the cache after completing. Optional. Default is false.
  • bounds A set of coordinates to clip the data with as minLong,minLat,maxLong,maxLat (using WGS84). Optional.
  • alert A function to be called with informational messages as Pantiler runs. Optional. Default does nothing.

Then run it:

await pantiler(tiledata)

Where tiledata is an object following the tilefile format, described below.

Tilefiles

Tilefiles are written in Yaml or Json. There is an example.yaml included for reference.

  • host The location the tiles will be served from.
  • zoomFrom The most zoomed-out level of tiles to generate.
  • zoomTo The most zoomed-in level of tiles to generate.
  • fonts An array of inputs specifying fonts in TTF or OTF format, which can then be referenced by name in the styling. Optional.
  • sprites An array of inputs specifying images in SVG format, which can then be referenced by name in the styling. Optional.
  • sources An array of sources.
  • styling Follows the Vector Tile Style specification, though with the glyphs and sources sections automatically generated, and so only needs to include a layers section at a minimum, which should expect a source named primary. This can be generated with Maputnik.

Inputs have this format:

  • name A unique name for this input.
  • url Specify either this or path. For a file that should be downloaded from the web.
  • path Specify either this or url. For a file that exists somewhere on your computer.
  • format If the path/url doesn't end with an extension indicating the file format, specify it here. Optional.
  • matching For archives containing multiple files specify a regular expression here to match which to use. Optional.

Inputs are merged together to produce each output. If the file is determined to be a Zip file (either through the extension or specified with format) it will be decompressed. Any pdf or txt files are ignored. If there is only one file left(or the files left constitute a Shapefile) that gets passed through to the next stage. If there are multiple files left then you'll get an error.

Sources have this format:

  • name A unique name for this source.
  • system A Proj string describing the spatial reference system (note this FAQ item about axis ordering).
  • fieldLongitude For CSV inputs with separate coordinates, specify the longitude column name. Optional.
  • fieldLatitude For CSV inputs with separate coordinates, specify the latitude column name. Optional.
  • inputs An array of inputs specifying geographical data.
  • outputs An array of outputs.

Outputs have this format:

  • name A unique name for this output, which can then be referenced as a source layer in the styling.
  • layer The name of the input layer that this output should use. Optional. Default is the first layer it finds.
  • filter Filter which features should be included, using SQL WHERE-clause format. Optional.
  • fields An object listing fields you want in the output to the names of those fields in the input layer. Optional.
  • zoomMin The most zoomed-out level of tiles that should include this data. Optional.
  • zoomMax The most zoomed-in level of tiles that should include this data. Optional.

Example

Download the example tilefile:

$ curl -L https://github.com/maxharlow/pantiler/raw/master/example.yaml > example.yaml

Run Pantiler, putting the output into a directory named tiles:

$ npx pantiler example.yaml tiles

Download the example tile viewer:

$ curl -L https://github.com/maxharlow/pantiler/raw/master/example.html > example.html

Serve the tiles and viewer locally:

$ npx local-web-server --hostname localhost --port 8080

You should now be able to see a map at localhost:8080/example.html.

There is also another example tilefile, example2.yaml, based on OpenStreetMap data.