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

cdbtiles

v0.0.4

Published

cdbtiles is a tilelive backend plug-in for CouchDB

Downloads

10

Readme

cdbtiles

cdbtiles is a tilelive.js backend (source/sink) plug-in for CouchDB

Q: What the heck does that mean?

A: With this installed, you can use CouchDB to read/write map image tiles from other tilelive.js sources/sinks (mbtiles, Mapnik, TileJSON, S3, etc.)

Q: Come again?

A: You can use CouchDB to serve maps over HTTP.

Q: Why would you want to do that?

A: For the same reasons you might want to do anything else with CouchDB... As one example, you could write a self-contained CouchApp with mapping functionality.

Q: Where do the maps come from?

A: That's a really big question. Weeks are probably required to fully grok what you are asking here.

Places to start:

Installation

You need node.js. Then:

 npm install cdbtiles

Nice! Now what?

Usage

Obviously, this works with (and depends upon) tilelive.js and CouchDB.

For example: Let's say you already have map tiles rendered with TileMill sitting in a .mbtiles file, and using something like TileStream to serve tiles alongside an application server isn't doing it for you. And you also happen to have a CouchDB server running locally.

You should be able to easily copy all of your data from the .mbtiles file to your local CouchDB (and then replicate it on from there) by setting up these other things:

 npm install tilelive
 npm install mbtiles

And then:

 ./node_modules/tilelive/bin/copy -s pyramid --minzoom=10 --maxzoom=18  "mbtiles:///Users/user/maps/Columbus.mbtiles" "cdbtiles://127.0.0.1:5984/columbus_tiles/"

The copy command above is a sample application provided by tilelive.js, and it has a bunch more options that you should check out. Tilelive is actually an API that any other app can use, so cdbtiles should enable CouchDB to play nicely with apps and other data sources/sinks that also support tilelive. The source and sink URIs have custom protocols (mbtiles: and cdbtiles:) that tilelive knows what to do with via the backend plugins you've now installed.

Now, if you point a Leaflet enabled web page page to http://127.0.0.1:5984/columbus_tiles/tile_{z}_{x}_{y}/tile you'll be serving up map tiles from CouchDB. Put that webpage in your CouchDB as well (left as an excercise for the reader), and you now have a self-contained map/application server running on CouchDB.

For what its worth, this also lets you to serve up the TileJSON information for your maps, just use: http://127.0.0.1:5984/columbus_tiles/tilejson