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

ghost-storage-b2

v0.0.7

Published

Storage adapter for Ghost that uses Backblaze B2

Downloads

25

Readme

Overview

This is a storage adapter for use with Ghost. It serves images over a public Backblaze B2 bucket to offload image asset serving from the Ghost Node.js application. It is best used in conjunction with Cloudflare. Cloudflare accelerates image loading via CDN caching and completely B2 bandwidth charges thanks to the Bandwidth Alliance.

Docker

If you run your Ghost in the official community Docker image, you can use this adapter by updating your base image to be pubbit/ghost:$VERSION-b2 instead.

Installation

You can install via fetching the package via Git or NPM and running npm install within the package directory.

NPM

# from the root of the Ghost installation
mkdir -p content/adapters/storage/b2
cd content/adapters/storage/b2
npm view ghost-storage-b2 dist.tarball | xargs curl -s | tar -xz --strip-components 1
npm install

Git

# from the root of the Ghost installation
sudo mkdir -p content/adapters/storage
cd content/adapters/storage
git clone https://github.com/gnalck/ghost-storage-b2.git b2
cd b2 && npm install

Configuration

After installation, you will need to update your production.config.json to have the required parameters. If using Docker, you can instead pass along the parameters as environmental variables instead, to avoid needing to further modify your image.

  "storage": {
    "active": "b2",
    "b2": {
      "applicationKeyId": "xxxxxxxxxxxx",
      "applicationKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "bucketId": "xxxxxxxxxxxxxxxxxxxxxxxx",
      "bucketName": "your-bucket",
      "host": "https://images.your-project.com",
      "pathPrefix": "optionalPath/" 
    }
  }

applicationKeyId

The identifier of your secret key.

applicationKey

The secret key for authorizing communication with Backblaze B2.

bucketId

The id of the bucket in Backblaze B2. Needed for communication with B2.

bucketName

The friendly-name of your bucket in Backblaze B2. Used to build up the public-facing URL we return from the storage adapter.

host

This should point at either your public Backblaze bucket (fXXX.backblazeb2.com) or your CNAME'd Cloudflare-proxying hostname that points to your public Backblaze bucket.

pathPrefix

This is an optional prefix to prepend to the path that images are saved in. Images by default are saved at the root of your bucket, you can use this to further nest your save path.

External Configuration

Backblaze

To find the root domain of your Backblaze bucket, you need to upload an arbitrary file to it and then navigate to the file details. The bucket name will show up as fXXX.backblazeb2.com.

the domain from the image details

You will either need to use that as your host in the config settings, or set up Cloudflare to proxy to that domain (see below).

Increase TTL (optional)

Ghost does not overwrite image assets. You can leverage this to set your Cache TTL to be arbitrarily long, with the knowledge that the data will never be "stale".

To increase the TTL to, e.g., 1 year, paste {"cache-control":"max-age=31536000"} into your Bucket Settings

updating the cache-control in bucket settings

Cloudflare (optional)

Using the bucket hostname you got above, you can set up Cloudflare to proxy a domain you own to your bucket.

DNS

In the example below, we point images.myproject.com to f000.backblazeb2.com. Make sure the record is proxied (the cloud is orange).

dns

SSL

You will want to enable Full/Strict SSL as well. Otherwise you may encounter an infinite redirect issue.

dns

Credits

Thanks to anazhd for helping with the README!