@dstanesc/s3-block-store
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

S3 Block Store

Simple content-addressable storage (CAS) based on AWS S3.

API

put: (block: { cid: any, bytes: Uint8Array }) => Promise<void>
get: (cid: any) => Promise<Uint8Array>

Usage

import AWS from 'aws-sdk'
import { blockStore } from '@dstanesc/s3-block-store'

AWS.config.update({region: 'us-east-1'})
const s3 = new AWS.S3()
const cache = {}
// bucket configured in https://s3.console.aws.amazon.com/s3/buckets
const bucket = ... 
// s3-block-store api
const { get, put } = blockStore({ /*cache,*/ s3, bucket });

Build

npm run clean
npm install
npm run build

Test

AWS storage configuration and security credentials

export AWS_BUCKET_NAME=...
export AWS_REGION=...

export AWS_SECRET_ACCESS_KEY=...
export AWS_ACCESS_KEY_ID=...
npm run test

Licenses

Licensed under either Apache 2.0 or MIT at your option.

Readme

Keywords

none

Package Sidebar

Install

npm i @dstanesc/s3-block-store

Weekly Downloads

1

Version

0.0.3

License

(Apache-2.0 AND MIT)

Unpacked Size

25.4 kB

Total Files

23

Last publish

Collaborators

  • dstanesc