Had some free time yesterday and I built something off of this data. Basically a package that allows

Had some free time yesterday and I built something off of this data. Basically a package that allows you to interact with buckets in different regions like you would a normal R2Bucket. Basic usage,
const localizedBucket = localizeBucket({
  buckets: {
    wnam: env.WNAM_BUCKET,
    enam: env.ENAM_BUCKET,
    weur: env.WEUR_BUCKET,
    eeur: env.EEUR_BUCKET,
    apac: env.APAC_BUCKET,
  },
  fallbackRegion: 'wnam',
});

const object = await localizedBucket.head('some-key', { request });

Not really sure how useful it is tbh, but it's there

https://github.com/flakey5/r2-localize
GitHub
Contribute to flakey5/r2-localize development by creating an account on GitHub.
Was this page helpful?