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

gcs-s3-adapter

v0.0.3

Published

English | [中文](README_cn.md)

Downloads

7

Readme

gcs-s3-adapter

English | 中文

gcs-s3-adapter is a library for self-hosting Omnivore. It implements a part of the GCS APIs with minio-js. It will replace @google-cloud/storage when the docker image is being built.

How to use it

You must change the packages/api/Dockerfile and packages/content-fetch/Dockerfile files. Here, we'll use the API as an example:

  1. Edit packages/api/Dockerfile

  2. Find:

RUN yarn install --pure-lockfile --production
  1. Add codes to replace @google-cloud/storage
RUN yarn install --pure-lockfile --production

# Replace @google-cloud/storage with gcs-s3-adapter
RUN yarn add --ignore-workspace-root-check gcs-s3-adapter
RUN rm -rf /app/node_modules/@google-cloud/storage
RUN ln -s /app/node_modules/gcs-s3-adapter /app/node_modules/@google-cloud/storage
  1. Edit docker-compose.yml to cofigure S3 paramaters
environment:
    # S3 paramaters
    - S3_HOST=<ip>
    - S3_PORT=<port>
    # optional
    - S3_ACCESS_KEY=xxx
    - S3_SECRET_KEY=xxx
    ...
  1. Build & run
docker-compose build api
docker-compose up -d

The content-fetch process is similar to this.

Other issues

message queue (Mandatory)

The content-fetch service will return the response to the API service via a message queue. Thus, the API service must start a queue processor to handle it. There are two approaches:

  • Edit packages/api/server.ts (this works for me)
...
import { createWorker } from './queue-processor'
...
const main = async (): Promise<void> => {
    ...
    // redis is optional for the API server
    if (env.redis.cache.url) {
        await redisDataSource.initialize()
    }

    // create queue processor
    let worker 
    if (redisDataSource.workerRedisClient) {
        worker = createWorker(redisDataSource.workerRedisClient)
    }
    ...
}

or

  • Edit docker-compose.yml, start a new process for the queue processor (untested)
services:
    ...
    queue:
        build:
            context: .
            dockerfile: ./packages/api/Dockerfile
        container_name: "omnivore-queue"
        command: ["yarn", "workspace", "@omnivore/api", "start_queue_processor"]
    ...

Note:I have not tested this.

Finally, configure Redis parameters for the message queue:

services:
    ...
    api:
        environment:
            - REDIS_URL=redis://redis:6379

image proxy (optional)

docker-compose does not contain an image proxy by default. You must deploy it yourself if you need it.

services:
    ...
    imageproxy:
        build:
            context: ./imageproxy
            dockerfile: ./Dockerfile
        container_name: "omnivore-image-proxy"
        ports:
            - "8080:8080"
        environment:
            - AWS_ACCESS_KEY_ID=xxx
            - AWS_SECRET_KEY=xxxx
            - IMAGE_PROXY_SECRET=some-secret
            - MEM_CACHE_SIZE_MB=100
            - GCS_IMAGES_PATH=s3://fake-region/omnivore-image/imgs?endpoint=<ip>:<port>&disableSSL=1&s3ForcePathStyle=1

Note: AWS_ACCESS_KEY_ID and AWS_SECRET_KEY must have a value, whether the S3 server needs it or not.

PDF (untested)

text-to-speech (untested)