Giter Club home page Giter Club logo

object-storage-js's Introduction

@relaycorp/object-storage

This library allows you to interact with major object storage backends (e.g., Amazon S3) using a unified interface.

Install

Releases are automatically pushed to NPM. For example, to get the latest release, run:

npm install @relaycorp/object-storage

Supported backends

Backend Name SDK used internally Access/secret key support
Amazon S3 s3 AWS Optional
Google Cloud Storage (GCS) gcs GCP Unsupported. Use alternative authentication methods instead, like workload identity.
Minio minio AWS Required

Supported operations

  • Get object (along with its metadata).
  • Create/update object (along with its metadata).
  • Delete object.
  • List objects under a given prefix. Pagination is handled automatically: We return an iterable and retrieve the next page lazily.

We welcome PRs to support additional operations, as long as each new operation is supported across all backends in a normalised way, and has unit and functional tests.

Example

import { initObjectStoreClient } from '@relaycorp/object-storage';

async function main(): Promise<void> {
  const client = initObjectStoreClient(
    process.env.STORE_BACKEND,
    process.env.STORE_ENDPOINT,
    process.env.STORE_ACCESS_KEY,
    process.env.STORE_SECRET_KEY,
  );

  for await (const objectKey of client.listObjectKeys("prefix/", process.env.STORE_BUCKET)) {
    console.log("- ", objectKey)
  }
}

API documentation

The API documentation can be found on docs.relaycorp.tech.

Contributing

We love contributions! If you haven't contributed to a Relaycorp project before, please take a minute to read our guidelines first.

object-storage-js's People

Contributors

dependabot[bot] avatar dependabot-preview[bot] avatar gnarea avatar relaybot-admin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.