https://github.com/relaycorp/object-storage-js
Node.js client for object stores like AWS S3, GCP GCS or Minio
https://github.com/relaycorp/object-storage-js
gcs minio object-storage object-store s3
Last synced: about 1 year ago
JSON representation
Node.js client for object stores like AWS S3, GCP GCS or Minio
- Host: GitHub
- URL: https://github.com/relaycorp/object-storage-js
- Owner: relaycorp
- License: mit
- Created: 2021-01-21T16:45:34.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-11-04T16:44:44.000Z (over 1 year ago)
- Last Synced: 2025-03-23T06:51:11.317Z (over 1 year ago)
- Topics: gcs, minio, object-storage, object-store, s3
- Language: TypeScript
- Homepage: https://docs.relaycorp.tech/object-storage-js/
- Size: 2.53 MB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @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](https://www.npmjs.com/package/@relaycorp/object-storage). 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](https://cloud.google.com/kubernetes-engine/docs/how-to/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
```typescript
import { initObjectStoreClient } from '@relaycorp/object-storage';
async function main(): Promise {
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](https://docs.relaycorp.tech/object-storage-js/).
## Contributing
We love contributions! If you haven't contributed to a Relaycorp project before, please take a minute to [read our guidelines](https://github.com/relaycorp/.github/blob/master/CONTRIBUTING.md) first.