New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@dstanesc/az-block-store

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dstanesc/az-block-store

Simple content-addressable storage (CAS) based on Azure Blob Storage

0.0.3
Version published
Weekly downloads
8
100%
Maintainers
1
Weekly downloads
 
Created

Azure Block Store

Simple content-addressable storage (CAS) based on Azure Blob Storage.

API

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

Usage

  // connect to Azure, see more @ https://learn.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-nodejs 
  const accountName = ...
  const blobServiceClient: BlobServiceClient = new BlobServiceClient(
    `https://${accountName}.blob.core.windows.net`,
    new DefaultAzureCredential()
  )
  const randomContainerName = ...
  containerClient: ContainerClient = blobServiceClient.getContainerClient(randomContainerName)
  await containerClient.create()

  // optional cache
  const cache = {}

  // az-block-store api
  const { get, put } = blockStore({ /*cache,*/ containerClient })

Build

npm run clean
npm install
npm run build

Test

Configure your storage account

export AZURE_STORAGE_ACCOUNT_NAME=xyz
npm run test

Licenses

Licensed under either Apache 2.0 or MIT at your option.

FAQs

Package last updated on 31 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts