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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@versatiles/google-cloud

v0.4.3

Published

A server for VersaTiles in Google Cloud Run

Downloads

120

Readme

Code Coverage GitHub Workflow Status)

VersaTiles Server for Google Cloud Run

This tool solves perfectly the use cases, when you want to publish multiple map application using multiple versatiles tile sources in Google Cloud. E.g. for data journalists, academia, ...

[!WARNING] It is strongly recommended:

  • always use a CDN in front of this server and
  • not to modify/overwrite existing files in the bucket, as this could result in corrupted data being delivered!

Outline:

  1. Store static files (*.html, *.js, *.css, …) and map tiles (*.versatiles) in a Google Storage Bucket.
  2. Run this Node.js server in Google Cloud Run using Bucket name/path as argument
  3. Put a Loadbalancer (with DNS and CDN) in front of the Google Cloud Run service.
  • Now you can serve the files in the Bucket publicly.
  • This server will make sure that every file will be compressed optimally according to "accept-encoding" header of the browser.
  • *.versatiles files will not be served. Instead the server will provide a simple GET API to access every tile, and serve them with optimal compression. E.g. tile x=4, y=5, z=6 in file gs://bucket/map/earth.versatiles could be accessed via https://public.domain.com/map/earth.versatiles?tiles/6/4/5

Run in Google Cloud Run

Run the following Docker Container in Google Cloud Run, e.g. by using Google Cloud Build.

FROM node:20-alpine
RUN npm install -g @versatiles/google-cloud
EXPOSE 8080
CMD npx versatiles-google-cloud -b "$BASE_URL" "$BUCKET_NAME"

Test locally

Install @versatiles/google-cloud globally and run:

npm install -g @versatiles/google-cloud
versatiles-google-cloud -f -l local/data/

Or clone and run the repo:

git clone https://github.com/versatiles-org/node-versatiles-google-cloud.git
cd node-versatiles-google-cloud
npm install
npm start -f -l local/data/

The arguments used:

  • -f or --fast-recompression disables recompression, so it's faster if you're developing locally.
  • -l or --local-directory uses a local directory instead of a Google Bucket.

Note that for security and performance reasons no file listing is implemented. If you have a file such as local/data/app/index.html you will need to open the correct URL in your browser to view the file: http://localhost:8080/app/index.html

Options